Collection of all partial functions is a set I'm studying real analysis from prof. Tao's book "Analysis 1" and I'm stuck on the following exercise:
"Let $ X $ , $ Y $ be sets. Define a partial function from $ X $ to $ Y $ to be any function $ f: X' -> Y' $ whose domain $ X' $ is a subset of $ X $, and whose range $ Y' $ is a subset of $ Y $.
Show that the collection of all partial functions from $ X $ to $ Y $ is itself a set."
My attempt:
I know that if I "build" the set  {  $Y_1^{X_1} , Y_2^{X_2},... $ } ($X_i \in 2^X$, $Y_i \in 2^Y$) then the result follows immediately from the axiom of union, so my goal is to build that set.
To do so I let $ X' $ be an arbitrary element of $ 2^X $ (power set of $X$) and for every $Y' \in  2^Y$ I let $ P(Y',y):="y=Y'^{X'}"$.
From the axiom of replacement I now know that the set {$f:X'->Y'| Y' \in 2^Y$}={$Y_1^{X'}, Y_2^{X'},...$} exists.
  Now I want to allow $X'$ in the set above to vary in $2^X$ (this, together with the axiom of union should be enough to conclude the proof) but I haven't been able to do it so far (I think I should use the axiom of replacement again but I don't know how to apply it).
So, I would appreciate any hint about how to conclude this last step.
Best regards,
lorenzo.

Given a set $Y$ and an element $X′$ of the power set $\mathcal{X}=\{X′:X′\subseteq X\}$ such that there is a unique power set $Y^{X′}$ for every $X′ \in X$. Then there is a set $\{Y^{X′}:X′\subseteq X\}$ such that for every $z$:
$$
z \in {Y^{X′}:X′ \subseteq X} \leftrightarrow z \text{ is the unique power set for some }X′.
$$
Now that $\{Y^{X′}:X′ \subseteq X\}$ is a set (of sets of partial functions from $X$ to $Y$) the union axiom may be applied to define the set of all partial functions from $X$ to $Y$ to be
$$ \bigcup\{Y^{X′}:X′ \subseteq X\}. $$
