[step:Split the clique factorization across the separating set]
Every clique $C$ of $H$ is contained in either $S_A\cup Z$ or $S_B\cup Z$. Indeed, if a clique contained one vertex in $S_A$ and one vertex in $S_B$, those two vertices would be adjacent in $H$, contradicting the absence of edges between $S_A$ and $S_B$.
Define nonnegative functions
\begin{align*}
\alpha:\prod_{u\in S_A\cup Z}\mathcal X_u\to [0,\infty)
\end{align*}
and
\begin{align*}
\beta:\prod_{u\in S_B\cup Z}\mathcal X_u\to [0,\infty)
\end{align*}
by assigning each factor $\psi_v$ to $\alpha$ when $C_v\subset S_A\cup Z$ and to $\beta$ otherwise. Since every $C_v$ is contained in one of the two sets, and any factor contained in both may be assigned to either side, the clique factorization becomes
\begin{align*}
p_S(x_S)=\alpha(x_{S_A},x_Z)\beta(x_{S_B},x_Z).
\end{align*}
We now compute the conditional density or mass function of $(X_{S_A},X_{S_B})$ given $X_Z=x_Z$ at any value $x_Z\in\mathcal X_Z$ for which the normalizing denominator is positive. Define the normalization maps $M_A:\mathcal X_Z\to[0,\infty]$ and $M_B:\mathcal X_Z\to[0,\infty]$ by
\begin{align*}
M_A(x_Z):=\int_{\mathcal X_{S_A}} \alpha(x_{S_A},x_Z)\,d\mu_{S_A}(x_{S_A})
\end{align*}
and
\begin{align*}
M_B(x_Z):=\int_{\mathcal X_{S_B}} \beta(x_{S_B},x_Z)\,d\mu_{S_B}(x_{S_B}).
\end{align*}
Here $\mu_{S_A}$ and $\mu_{S_B}$ are the product dominating measures defined above, with sums replacing integrals in the discrete case. Let $p_Z:\mathcal X_Z\to[0,\infty)$ denote the marginal density or mass function of $X_Z$ with respect to $\mu_Z$. By Tonelli's theorem applied to the nonnegative function $p_S$, integration first over $\mathcal X_{S_A}$ and $\mathcal X_{S_B}$ gives
\begin{align*}
p_Z(x_Z)=M_A(x_Z)M_B(x_Z)
\end{align*}
for $\mu_Z$-almost every $x_Z\in\mathcal X_Z$. Let $\mathbb P_{X_Z}$ denote the law of $X_Z$, that is, the pushforward measure $\mathbb P\circ X_Z^{-1}$ on $(\mathcal X_Z,\mathcal E_Z)$. Let $N\subset\mathcal X_Z$ be the measurable set on which this identity fails or on which $p_Z(x_Z)=0$; then $\mathbb P_{X_Z}(N)=\mathbb P(X_Z\in N)=0$.
For $x_Z\in\mathcal X_Z\setminus N$, define versions of the conditional density or mass functions by
\begin{align*}
p_{S_A,S_B\mid Z}(x_{S_A},x_{S_B}\mid x_Z):=\frac{\alpha(x_{S_A},x_Z)\beta(x_{S_B},x_Z)}{M_A(x_Z)M_B(x_Z)}
\end{align*}
for $(x_{S_A},x_{S_B})\in\mathcal X_{S_A}\times\mathcal X_{S_B}$,
\begin{align*}
p_{S_A\mid Z}(x_{S_A}\mid x_Z):=\frac{\alpha(x_{S_A},x_Z)}{M_A(x_Z)}
\end{align*}
for $x_{S_A}\in\mathcal X_{S_A}$, and
\begin{align*}
p_{S_B\mid Z}(x_{S_B}\mid x_Z):=\frac{\beta(x_{S_B},x_Z)}{M_B(x_Z)}
\end{align*}
for $x_{S_B}\in\mathcal X_{S_B}$. If, for a $\mu_Z$-null exceptional value, one of the displayed denominators is not positive and finite, define the corresponding conditional densities arbitrarily as any probability density or mass function on the relevant coordinate space. This arbitrary choice does not affect conditional independence, because conditional independence given $X_Z$ is an almost-sure statement with respect to the law of $X_Z$.
For every $x_Z\in\mathcal X_Z\setminus N$, the displayed definitions give
\begin{align*}
p_{S_A,S_B\mid Z}(x_{S_A},x_{S_B}\mid x_Z)=p_{S_A\mid Z}(x_{S_A}\mid x_Z)p_{S_B\mid Z}(x_{S_B}\mid x_Z).
\end{align*}
Hence the factorization of conditional densities holds for $\mathbb P_{X_Z}$-almost every conditioning value, which is precisely
\begin{align*}
X_{S_A}\perp\!\!\!\perp X_{S_B}\mid X_Z.
\end{align*}
[/step]