What methods are there to solve the following linear matrix equation for $X$
$$AXA^T=B$$
where $X$ and $B$ are real square matrices, $X$ is symmetric and $A$ might not be square.
OBS: I could reduce the problem to a more special case in which $B$ is diagonal.
With $X=(x_{ij})\in M_n(K)$ we have a system of linear equations in the variables $x_{ij}$, which can be solved by standard methods.