This is described in the SM microscope control program manual. In the chapter Running STXM IV: the essentials, find the section Acquisition of spectromicroscopy ``stacks'' or ``spectrum images''.