Say $S = \Spec(R)$. Then we can choose a closed immersion of $X$ into the spectrum of $R[x_i; i \in I]$ for some set $I$ (of sufficiently large cardinality. Hence by Lemma \ref{lemma-hilb-d-of-closed} we may assume that $X = \Spec(A)$ where $A = R[x_i; i \in I]$. We will use Schemes, Lemma \ref{schemes-lemma-glue-functors} to prove the lemma in this case. \medskip\noindent Condition (1) of the lemma follows from Lemma \ref{lemma-hilb-d-sheaf}. \medskip\noindent For every subset $W \subset A$ of cardinality $d$ we will construct a subfunctor $F_W$ of $\Hilbfunctor^d_{X/S}$. (It would be enough to consider the case where $W$ consists of a collection of monomials in the $x_i$ but we do not need this.) Namely, we will say that $Z \in \Hilbfunctor^d_{X/S}(T)$ is in $F_W(T)$ if and only if the $\mathcal{O}_T$-linear map $$ \bigoplus\nolimits_{f \in W} \mathcal{O}_T \longrightarrow (Z \to T)_*\mathcal{O}_Z,\quad (g_f) \longmapsto \sum g_f f|_Z $$ is surjective (equivalently an isomorphism). Here for $f \in A$ and $Z \in \Hilbfunctor^d_{X/S}(T)$ we denote $f|_Z$ the pullback of $f$ by the morphism $Z \to X_T \to X$. \medskip\noindent Openness, i.e., condition (2)(b) of the lemma. This follows from Algebra, Lemma \ref{algebra-lemma-cokernel-flat}. \medskip\noindent Covering, i.e., condition (2)(c) of the lemma. Since $$ A \otimes_R \mathcal{O}_T = (X_T \to T)_*\mathcal{O}_{X_T} \to (Z \to T)_*\mathcal{O}_Z $$ is surjective and since $(Z \to T)_*\mathcal{O}_Z$ is finite locally free of rank $d$, for every point $t \in T$ we can find a finite subset $W \subset A$ of cardinality $d$ whose images form a basis of the $d$-dimensional $\kappa(t)$-vector space $((Z \to T)_*\mathcal{O}_Z)_t \otimes_{\mathcal{O}_{T, t}} \kappa(t)$. By Nakayama's lemma there is an open neighbourhood $V \subset T$ of $t$ such that $Z_V \in F_W(V)$. \medskip\noindent Representable, i.e., condition (2)(a) of the lemma. Let $W \subset A$ have cardinality $d$. We claim that $F_W$ is representable by an affine scheme over $R$. We will construct this affine scheme here, but we encourage the reader to think it trough for themselves. Choose a numbering $f_1, \ldots, f_d$ of the elements of $W$. We will construct a universal element $Z_{univ} = \Spec(B_{univ})$ of $F_W$ over $T_{univ} = \Spec(R_{univ})$ which will be the spectrum of $$ B_{univ} = R_{univ}[e_1, \ldots, e_d]/ (e_ke_l - \sum c_{kl}^m e_m) $$ where the $e_l$ will be the images of the $f_l$ and where the closed immersion $Z_{univ} \to X_{T_{univ}}$ is given by the ring map $$ A \otimes_R R_{univ} \longrightarrow B_{univ} $$ mapping $1 \otimes 1$ to $\sum b^le_l$ and $x_i$ to $\sum b_i^le_l$. In fact, we claim that $F_W$ is represented by the spectrum of the ring $$ R_{univ} = R[c_{kl}^m, b^l, b_i^l]/\mathfrak a_{univ} $$ where the ideal $\mathfrak a_{univ}$ is generated by the following elements: \begin{enumerate} \item multiplication on $B_{univ}$ is commutative, i.e., $c_{lk}^m - c_{kl}^m \in \mathfrak a_{univ}$, \item multiplication on $B_{univ}$ is associative, i.e., $c_{lk}^m c_{m n}^p - c_{lq}^p c_{kn}^q \in \mathfrak a_{univ}$, \item $\sum b^le_l$ is a multiplicative $1$ in $B_{univ}$, in other words, we should have $(\sum b^le_l)e_k = e_k$ for all $k$, which means $\sum b^lc_{lk}^m - \delta_{km} \in \mathfrak a_{univ}$ (Kronecker delta). \end{enumerate} After dividing out by the ideal $\mathfrak a'_{univ}$ of the elements listed sofar we obtain a well defined ring map $$ \Psi : A \otimes_R R[c_{kl}^m, b^l, b_i^l]/\mathfrak a'_{univ} \longrightarrow \left(R[c_{kl}^m, b^l, b_i^l]/\mathfrak a'_{univ}\right) [e_1, \ldots, e_d]/(e_ke_l - \sum c_{kl}^m e_m) $$ sending $1 \otimes 1$ to $\sum b^le_l$ and $x_i \otimes 1$ to $\sum b_i^le_l$. We need to add some more elements to our ideal because we need \begin{enumerate} \item[(5)] $f_l$ to map to $e_l$ in $B_{univ}$. Write $\Psi(f_l) - e_l = \sum h_l^me_m$ with $h_l^m \in R[c_{kl}^m, b^l, b_i^l]/\mathfrak a'_{univ}$ then we need to set $h_l^m$ equal to zero. \end{enumerate} Thus setting $\mathfrak a_{univ} \subset R[c_{kl}^m, b^l, b_i^l]$ equal to $\mathfrak a'_{univ} + $ ideal generated by lifts of $h_l^m$ to $R[c_{kl}^m, b^l, b_i^l]$, then it is clear that $F_W$ is represented by $\Spec(R_{univ})$.