One can assume without loss of generality that $\theta=\frac12$, hence $X_1$ and $X_2$ are i.i.d. uniform on $[0,1]$, and compute the distribution of $(X,Z)$. Since $Z=|X_1-X_2|$, for every test function $u$, $ \mathrm E(u(X,Z))=\iint u\left(\tfrac12(x_1+x_2),|x_1-x_2|\right)\,[0\leqslant x_1,x_2\leqslant 1]\,\mathrm dx_1\mathrm dx_2. $ The change of variable $x=\tfrac12(x_1+x_2)$, $z=|x_1-x_2|$, yields $x_1=x\pm \frac12z$, $x_2=x\mp\frac12z$, $dx_1dx_2=2dxdz$ (the factor $2$ for the fact that two points $(x_1,x_2)$ correspond to the same point $(x,z)$), and $ \mathrm E(u(X,Z))=\iint u(x,z)\,2\,[0\leqslant 2x\pm z\leqslant2,\,z\geqslant0]\,\mathrm dx\mathrm dz. $ The indicator function is $[z\leqslant 2x\leqslant2-z,\,0\leqslant z\leqslant1]$, hence $(X,Z)$ is uniform on this set (this is the triangle in the $(x,z)$ plane with vertices $(0,0)$, $(1,0)$ and $(\tfrac12,1)$) and, conditionally on $[Z=z]$ for some $z$ in $[0,1]$, $X$ is uniform on the set $\{x\mid z\leqslant2x\leqslant2-z\}$, which is the interval $[\frac12z,1-\tfrac12z]$.
If $\theta\ne\frac12$, $X_1$, $X_2$, $Y_1$, $Y_2$ and $X$ are shifted by $\theta-\frac12$ and $Z$ is unchanged hence, conditionally on $[Z=z]$ for some $z$ in $[0,1]$, $X$ is uniform on the interval $[\theta-\frac12+\frac12z,\theta+\frac12-\tfrac12z]$.
This, or draw a picture.