(For the original question): As $X$ is positive definite, its rank equals to $m$, and there will be no solution $T$ with $n<m$.
On the other hand if your $n>m$ then you can append the corresponding number of 0 rows to $Z$ from the Cholesky decomposition and obtain the matrix $T$ sought.
For the positive semidefinite case (the edited question): you still can compute the Cholesky-like decomposition; see Cholesky decomposition of a positive semi-definiteCholesky decomposition of a positive semi-definite
(I edited my 2nd edition, as it was nonsense, and made my answer community wiki)