$X^\omega$ is separable if $X$ is separable How should one interpret the following proof:

I don't get the proof that $X^\omega$ (under the product topology) is separable if $X$ is separable. In fact, I'm not sure what topology $X$ is supposed to have. The context is Polish spaces. Maybe someone with more experience in descriptive set theory recognizes what I'm missing here?

It doesn’t matter what the topology on $X$ is, so long as it is separable. A basic open set $B$ in ${^\omega}X$ has the following form: there are a finite $F\subseteq\omega$ and open sets $U_k$ in $X$ for each $k\in F$ such that
$$B=\left\{\bar x\in{^\omega}X:\bar x_k\in U_k\text{ for each }k\in F\right\}\,.$$
The family $\{z_n:n\in\omega\}$ is dense in $X$, so for each $k\in F$ there is an $n(k)\in\omega$ such that $z_{n(k)}\in U_k$.
The set $B_0=\left\{f\in{^\omega}\omega:f(k)=n(k)\text{ for each }k\in F\right\}$ is a basic open set in the Baire space ${^\omega}\omega$, and $D$ is dense in ${^\omega}\omega$, so $f\in B_0\cap D\ne\varnothing$. Let $f\in B_0\cap D$; then $\bar z_f(k)=z_{f(k)}=z_{n(k)}$ for each $k\in F$, so $\bar z_f\in B$.
Thus, each basic open set in ${^\omega}X$ contains a member of the countable set $\{\bar z_f:f\in D\}$, and ${^\omega}X$ is therefore separable.
