In situ studies of nanoparticles under reaction with sulfur by XAS