Electronic structure of Nb, NbC, and NbN studied by X-ray emission