The reduced size and dimensionality of layered magnetic nanostructures enhances the role that surfaces and interfaces play in determining their magnetic structures. This can result in inhomogeneous magnetic states, wherein the local magnetization varies with distance away from surfaces or interfaces. Using hard x-ray magnetic circular dichroism and x-ray resonant magnetic scattering, we explore the nature of such inhomogeneous states in Gd/Fe metallic multilayers and SmCo/Fe spring magnets. In collaboration with Y. Choi, J. Lang, D. Lee, G. Srajer, C. Kmety, J. Pollmann, C. Nelson, R. Camley, J. Meersschaut, J.S. Jiang, S.D. Bader Work at Argonne is supported by the U.S. Department of Energy, Office of Science under contract No. W-31-109-ENG-38.