Real-time X-ray photoelectron spectroscopy of surface reactions