  A detailed study of the near-surface structure and composition of Nb, the
material of choice for Superconducting Radio Frequency accelerator (SRF)
cavities, is of great importance in order to understand the effects of
different treatments applied during cavity production. By means of
surface-sensitive techniques such as grazing incidence diffuse X-ray
scattering, X-ray reflectivity and X-ray photoelectron spectroscopy,
single-crystalline Nb(100) samples were investigated in and ex-situ during
annealing in UHV as well as in nitrogen atmospheres with temperatures and
pressures similar to the ones employed in real Nb cavity treatments. Annealing
of Nb specimens up to 800{\deg}C in vacuum promotes partial reduction of the
natural surface oxides (Nb2O5, NbO2, NbO) into NbO. Upon cooling to 120{\deg}C,
no evidence of nitrogen-rich layers was detected after nitrogen exposure times
of up to 48 hours. Oxygen enrichment below the Nb/oxide interface and posterior
diffusion of oxygen species towards the Nb matrix, along with a partial
reduction of the natural surface oxides was observed upon a stepwise annealing
up to 250{\deg}C. Nitrogen introduction to the system at 250{\deg}C neither
promotes N diffusion into the Nb matrix nor the formation of new surface
layers. Upon further heating to 500{\deg}C in a nitrogen atmosphere, the growth
of a new subsurface Nb$_x$N$_y$ layer was detected. These results shed light on
the composition of the near-surface region of Nb after low-temperature nitrogen
treatments, which are reported to lead to a performance enhancement of SRF
cavities.
