Lemma 15.43 in Jech's "Set Theory" states that if $V \subseteq M \subseteq V[G]$ where $G \subseteq \mathbb{P}$ is some $V$-generic filter and $M$ is a transitive models of ZFC, then $M = V[D \cap G]$ for some complete subalgebra.
In the proof, he states that since $M$ models choice, for every $X \in M$, there is a set of ordinals $A_X$ such that $X \in V[A_X]$.
I do not see what this set $A_X$ should be and how to construct $X$ in $V[A_X]$. I believe the idea should be that the axiom of choice can be used to show that $X$ is in bijection with some ordinals. However, it is not clear why the coding of this set by ordinals is necessarily in $V$ or $V[A_X]$ for an appropriately chosen set.
Is this the correct approach?