  The analysis of x-ray reflectivity data from artificial heterostructures
usually relies on the homogeneity of optical properties of the constituent
materials. However, when the x-ray energy is tuned to an absorption edge, this
homogeneity no longer exists. Within the same material, spatial regions
containing elements at resonance will have optical properties very different
from regions without resonating sites. In this situation, models assuming
homogeneous optical properties throughout the material can fail to describe the
reflectivity adequately. As we show here, resonant soft x-ray reflectivity is
sensitive to these variations, even though the wavelength is typically large as
compared to the atomic distances over which the optical properties vary. We
have therefore developed a scheme for analyzing resonant soft x-ray
reflectivity data, which takes the atomic structure of a material into account
by "slicing" it into atomic planes with characteristic optical properties.
Using LaSrMnO4 as an example, we discuss both the theoretical and experimental
implications of this approach. Our analysis not only allows to determine
important structural information such as interface terminations and stacking of
atomic layers, but also enables to extract depth-resolved spectroscopic
information with atomic resolution, thus enhancing the capability of the
technique to study emergent phenomena at surfaces and interfaces.
