Oxidation of cerium and titanium studied by photoelectron spectroscopy