Combining non-specular X-ray scattering and X-ray absorption spectroscopy for the investigation of buried layers