Suppose you want to form $\{z\in X\mid \varphi(z,\vec w,X)\}$, without using Separation.
Either there exists $z$ such that $z\in X\land \varphi(z,\vec w,X)$ or there doesn't. In the latter case, the set you're after is the empty set, whose existence is given by axiom 0.
Otherwise, let $Z$ be one such $z$, and then apply Replacement with $A'=X$, $\vec w'=\vec w\|Z$ and$$ \varphi'(x,y,\vec w,Z,X) \equiv (\varphi(x,\vec w,X) \land y=x) \lor(\neg\varphi(x,\vec w,X) \land y=Z) $$(where primed variables are those that appear in Replacement, and the unprimed are the ones we already have).Then the $\exists!$ part of Replacement is trivial, and the $B$ you get is the desired subset of $X$.
There's nothing particularly circular here -- if you have a proof that involves both Separation and Replacement you can mechanically replace all instances of Separation using the above proof schema, and this gives you a proof of the original theorem that doesn't use Separation.