A slightly different answer from that of user1551.
If A is symmetric, positive demidefinite, then there is an orthogonal matrix t (actually a rotation-matrix), such that
$$ t' \cdot A \cdot t = D \qquad \text{where also} \qquad t'=t^{-1} $$
where D is diagonal. Then t is also an eigenmatrix of A.
So we can write our problem: search X such that
$$ X \cdot A \cdot X' = X \cdot (t D t')\cdot X' = A $$
If now X itself is composed from the eigenmatrix t and has a diagonal which in any case needs to be different from the unit-matrix (otherwise $tEt'=I$ is the unwanted trivial solution), such that
$$ X = t \cdot E \cdot t' $$ then we have
$$ (t E t') \cdot (t D t')\cdot (t E t')' = A \tag1$$
Now, $ (tEt')' = tE't'= tEt' $ and thus (1) becomes
$$ (t E t') \cdot (t D t')\cdot (t E t') = A \tag2$$
Because $t'=t^{-1}$ the intermediate products, where $t \cdot t'$ occurs cancel and we get
$$ t E \cdot D \cdot E t' = A \tag3$$
so it is required that $E D E = D $. This means, we need E as a diagonal matrix, whose entries are not all $1$ but whose squares give all $1$, so one example for matrices with size $4\times 4$ is $$E=\operatorname{diag}[1,-1,1,-1] \tag 4$$
Finally, all solutions, where the diagonal entries of E are $ e_{k,k} \in (1,-1) $ except the two cases $ E = \operatorname{diag}(1,1,1,1) $ and $ E = \operatorname{diag}(-1,-1,-1,-1) $ are the nontrivial solutions for X.
Numerical example:
A :
20.6165 12.5909 17.9791 9.6834
12.5909 15.0880 15.0857 12.8075
17.9791 15.0857 19.2621 13.6685
9.6834 12.8075 13.6685 13.2206
t :
0.5305 0.4722 0.5674 0.4168
-0.7142 0.3846 -0.0782 0.5796
-0.0843 -0.7876 0.3882 0.4711
0.4489 -0.0940 -0.7220 0.5181
D :
58.6643 0.0000 0.0000 -0.0000
0.0000 7.9444 0.0000 -0.0000
-0.0000 -0.0000 1.3392 -0.0000
0.0000 0.0000 -0.0000 0.2393
Then in fact $A = t \cdot D \cdot t' $
E :
1.0000 0.0000 0.0000 0.0000
0.0000 -1.0000 0.0000 0.0000
0.0000 0.0000 1.0000 0.0000
0.0000 0.0000 0.0000 -1.0000
Then we create $ X = t \cdot E \cdot t' $
X :
-0.4230 0.6337 0.5365 0.3628
0.6337 0.6865 -0.0756 -0.3484
0.5365 -0.0756 -0.0547 0.8387
0.3628 -0.3484 0.8387 -0.2088
Then we build the product $ X \cdot A \cdot X' = Z $ and find that in fact $Z = A$
Z = X * A * X'
Z :
20.6165 12.5909 17.9791 9.6834
12.5909 15.0880 15.0857 12.8075
17.9791 15.0857 19.2621 13.6685
9.6834 12.8075 13.6685 13.2206
err = Z - A
err :
-0.0000 -0.0000 -0.0000 0.0000
-0.0000 0.0000 0.0000 0.0000
-0.0000 0.0000 -0.0000 0.0000
0.0000 0.0000 0.0000 0.0000