As $\gcd(x_{1}, x_{2}) = d$, there exists an $n, m$, such that:
$x_{1} = \pm \;d\cdot m$ with $m \geq 1$
and
$x_{2} = \pm \;d\cdot n$, with $n\geq 1$.
Their sign should be the same as a square is positive.
Now as $d^{2} \vdash x_{1}x_{2}$, $nm = \frac{x_{1}x_{2}}{d^{2}}$ should be also square.
Also as $\gcd(x_{1}, x_{2}) = d$, $\gcd(\frac{x_{1}}{d}, \frac{x_{2}}{d})=1$, that is $\gcd(n, m) = 1$, $n$ and $m$ should be also square.
This means there exists an $N\geq 1$ and an $M\geq 1$, such that:
$n = N^{2}$ and $m = M^{2}$.
Note
To prove that:
if two numbers $a, b$, with $\gcd(a, b) = 1$ have a square product each of them should be a square
you can say that:
if there exists a prime number such that $p^{2k} \vdash ab$, then either $p^{2k} \vdash a $ or $p^{2k} \vdash b$, because otherwise $\gcd(a, b) \neq 1$