According to Wikipedia, the recursion theorem states the following:
Let $X$ be a set, and $f:X\to X$ a function. For any $x\in X$, there exists a unique function $g:\omega\to X$ such that $g(0)=x$ and $$g(S(n))=f(g(n))$$ for all $n\in\omega$.
My question is: is the recursion theorem still valid if $X$ is a class instead of a set (and $f$ is a functional relation)?
Indeed, if you look at the proof of the recursion theorem, you should find that at no point is the fact that $X$ is a set ever used.
There's actually a more general version than that, though, called Transfinite Recursion. See Wikipedia again for more info.