We report a noticeable depth sensitivity of soft x-ray resonant magneto-optical Kerr effect able to resolve depth-varying magnetic heterostructures in ultrathin multilayer films. For various models of depth-varying magnetization orientations in an ultrathin Co layer of realistic complex layered structures, we have calculated the Kerr rotation, ellipticity, intensity spectra versus grazing incidence angle φ, and their hysteresis loops at different values of φ for various photon energies ν 's near the Co resonance regions. It is found from the simulation results that the Kerr effect has a much improved depth sensitivity and that its sensitivity varies remarkably with φ and ν in the vicinity of the resonance regions. These properties originate from a rich variety of wave interference effects superimposed with noticeable features of the refractive and absorptive optical effects near the resonance regions. Consequently, these allow us to resolve depth-varying magnetizations and their reversals varying with depth in a single magnetic layer and allow us to distinguish interface magnetism from the bulk properties in multilayer films. In this paper, the depth sensitivity of the Kerr effect with an atomic-scale resolution is demonstrated and discussed in details in several manners with the help of model simulations for various depth-varying spin configurations.