Transfinite Recursion Theorem for Ordinals