Let $\mathcal X \subset \mathbb R^d$ be compact. Suppose $X(x)$ is a random variable $\Omega \to \mathcal X$ and $F^{(x)}$ is a random variable that takes values in some set of functions $ \mathcal X \to \mathbb R$. We assume the two variables are independent. For each $Y \in \mathcal X$ define the expected value of $F^{(x)}(Y)$ as
$$F(Y) = \mathbb E[F^{(x)}(Y)].$$
I would like to show that $$\mathbb E[F^{(x)}(X(x))] = \mathbb E[F (X(x))].$$
In the finite case we can write the left-hand-side as $$ \int \int F^{(x)}(X(y)) dP(x)dP(y) = \int \sum_i p_i F_i(X(y)) dP(y) $$ $$ = \sum_i \int p_i F_i(X(y)) dP(y)= \sum_i \sum_j q_j p_i F_i(X_j) = \mathbb E[F^{(x)}(X(x))].$$
The last equality follows from independence and the definition of the integral in the finite case.
How do I prove this in the general case when $X(x)$ and $F^{(x)}$ can take continuously many different values?