Commuting operators and Direct product spaces Under what conditions is the common eigenspace of two commuting hermitian operators isomorphic to the direct product of their individual eigenspaces? When can an eigenket $|\lambda$1$\lambda$2$\rangle$ be considered to be equivalent to the ket $|\lambda$1$\rangle$$|\lambda$2$\rangle$?


For example, the simultaneous eigenkate of cartesian $X$ and $Y$ operators, $|xy\rangle$, can be equivalently written as $|x\rangle|y\rangle$. But, as far as I know, the simultaneous eigenkate of Lz and L2 operators, $|lm\rangle$, cannot be represented as a direct product of two eigenkets. 
 A: Consider self-adjoint operators $A$ and $B$, on a Hilbert space $\mathscr{H}$.
Roughly speaking (forgetting about domains of definition), it is possible only if your Hilbert space can be written as $\mathscr{H}=\mathscr{H}_1\otimes \mathscr{H}_2$; where $\mathscr{H}_1$ and $\mathscr{H}_2$ are Hilbert spaces such that: $A=A_1\otimes 1$ and $B=1\otimes B_2$, with $A_1$ an operator on $\mathscr{H}_1$, $B_2$ on $\mathscr{H}_2$, and $1$ the identity operator (on either of the two spaces).
edit [ tentative rigorous proof, using spectral families ]. (what follows is quite technical, but gives a rigorous restatement of what is explained heuristically above)
Proposition: On $\mathscr{H}=\mathscr{H}_1\otimes\mathscr{H}_2$ the following conditions are equivalent:
1) There are two self-adjoint operators such that: $A=A_1\otimes 1$, with $A_1$ defined on $D(A_1)\subseteq \mathscr{H}_1$; and $B=1\otimes B_2$ with $B_2$ defined on $D(B_2)\subseteq \mathscr{H}_2$.
2) $A$ and $B$ are commuting self-adjoint operators on $D(A)\cap D(B)\subseteq \mathscr{H}$ and the common spectral family $\{\chi_{\Omega_1,\Omega_2}(A,B)\}$ satisfies the following property:
There exist two spectral families $\{\chi_{\Omega}(A_1)\}$ on $\mathscr{H}_1$ and $\{\chi_{\Omega}(B_2)\}$ on $\mathscr{H}_2$ ($\Omega$ a Borel subset of $\mathbb{R}$) such that
$$\chi_{\Omega_1,\Omega_2}(A,B)=\chi_{\Omega_1}(A_1)\otimes\chi_{\Omega_2}(B_2) \; .$$
proof: 1) $\Rightarrow$ 2) is straightforward, and $\{\chi_\Omega(A_1)\}$ is the spectral family associated to $A_1$, $\{\chi_\Omega(B_2)\}$ the one associated with $B_2$.
2) $\Rightarrow$ 1): Let $d\chi_{\lambda}(A)$ be the projection valued measure associated to $A$, and $d\chi_\lambda (B)$ the projection valued measure associated to $B$. Since $A$ and $B$ commute, they have a common spectral family, that is "finer" than each one, in the sense that, denoting by $\mathscr{H}_\Omega(A)$ the range of $\chi_\Omega(A)$ and by $\mathscr{H}_{\Omega,\Omega_2}(A,B)$ the range of the common spectral family $\chi_{\Omega,\Omega_2}(A,B)$ we have that for any $\Omega_2\subseteq \mathbb{R}$:
$$\mathscr{H}_{\Omega,\Omega_2}(A,B)\subseteq \mathscr{H}_\Omega(A)\; ,$$
the equality is satisfied if and only if $\Omega\supseteq \sigma(B)$ (the spectrum of $B$). If we denote by $d\chi_{\lambda_1,\lambda_2}(A,B)$ the spectral measure corresponding to the common family, we have the following representation of $A$:
$$A=\iint\lambda_1 d\chi_{\lambda_1,\lambda_2}(A,B)\; .$$
Now we use the fact that: $\chi_{\Omega_1,\Omega_2}(A,B)=\chi_{\Omega_1}(A_1)\otimes\chi_{\Omega_2}(B_2)$ $\Rightarrow$ $d\chi_{\lambda_1,\lambda_2}(A,B)=d\chi_{\lambda_1}(A_1)d\chi_{\lambda_2}(B_2)$:
$$A=\iint\lambda_1 d\chi_{\lambda_1}(A_1)d\chi_{\lambda_2}(B_2)=\int\lambda_1 d\chi_{\lambda_1}(A_1)\otimes 1\; .$$
That defines the operator $A_1=\int\lambda_1 d\chi_{\lambda_1}(A_1)$, on $D(A_1)\subseteq\mathscr{H}_1$. The definition of $B_2$ is perfectly analogous.
If I am not mistaken, it seems therefore that condition 1) is really necessary and sufficient to have what the OP is asking (written here in a more general form).
Note: there are no assumptions on degeneracy of the eigenvalues, or discreteness of the spectrum and so on...(hoping, obviously, the proof is correct)
A: The only crucial point is the degeneracy of eigenspaces.
Consider the  finite dimensional Hilbert space $\cal H$ (the extension to the infinite dimensional case is  more difficult also because a part of continuous spectrum may appear) and a pair of commuting Hermitian operators $A$ and $B$ on that space such that the following requirement is satisfied.
R.: There is a basis of ${\cal H}$ made of common eigenvectors with exacly the form
$$\{| a, b\rangle \:|\: a \in \sigma(A)\:, b\in \sigma(B)\}$$
where $A|a,b\rangle = a|a, b\rangle$ and $B|a,b\rangle = b|a, b\rangle$ for all
$a \in \sigma(a)$ and $b \in \sigma(B)$.
Notice that R. has to be understood literally, I mean, the eigenspace of $A$ with eigenvalue $a$is exactly the span of the vectors $|a, b\rangle$ where $b$ ranges in the whole $\sigma(B)$ and vice versa if swapping $A$ and $B$.
In particular, the dimension of every eigenspace of $A$ is the same and is given by the number of elements of $\sigma(B)$ and viceversa.
Under these hypotheses if $n(A)$ and $n(B)$ respectively are the number of elements in $\sigma(A)$ and $\sigma(B)$,  costruct
$$A' : {\mathbb C}^{n(A)} \to {\mathbb C}^{n(A)}\:, \quad B' : {\mathbb C}^{n(B)} \to {\mathbb C}^{n(B)}$$
as the Hermitian operators defined by the matrices $diag(a_1,\ldots, a_{n(A)})$
and $diag(b_1,\ldots, b_{n(B)})$ respectively (the order is arbitrary but fixed). Finally, if $e_1,\ldots, e_{n(A)}$ is the canonical basis of $ {\mathbb C}^{n(A)}$, use the notation $|a_j\rangle := e_{j}$ and adopt the analogous convention for ${\mathbb C}^{n(B)}$.
Since $dim {\cal H}= n(A)n(B) = dim({\mathbb C}^{n(A)}\otimes {\mathbb C}^{n(B)})$, it is evident that the map interpolating between two bases of the relevant spaces,
$$U:  {\mathbb C}^{n(A)} \otimes  {\mathbb C}^{n(B)} \ni |a_i\rangle |b_j \rangle \mapsto |a_i b_j \rangle \in {\cal H} \quad (a_i,b_j) \in \sigma(A) \times \sigma(B) \tag{U1}$$
linearly extends to a Hilbert space isomorphism such that
$$U (A'\otimes I) U^{-1} =A \quad \mbox{and}\quad U (I\otimes B') U^{-1} =B \tag{U2} $$
I proved that R is a sufficient hypothesis which guarantees the existence of the unitary map $U$ as in (U1) verifying (U2). The converse is trivially true. The extension to the infinite dimensional case is straightforward if the operators have pure point spectrum. The case of more than two commuting operators can be treated analogously.
At least formally, you can see that the hypothesis R is valid for the operators $X$ and $Y$ in your question, but it is not for $J^2$ and $J_z$ because the degeneracy of eigenspaces of $J^2$ depends on the eigenvalue. In this case however, the Hilbert space  can be decomposed as a direct sum of subspaces isomorphic to suitable tensor products...
