A theory of spin polarization of resonant photoemission in nickel