The surface segregation of Mg and Si dopant species and their atomic incorporation sites in GaN films grown by metal-organic vapour phase epitaxy (MOVPE) on sapphire (0001) substrates have been analysed by X-ray photoemission spectro-microscopy and X-ray standing waves (XSW). As revealed by spectro-microscopy, both Mg and Si tend to segregate to the surface. In case of Mg, an enhanced surface dopant concentration is found even after sputter-removal of several tens of nanometres, which confirms a segregation mechanism proposed earlier [S. Figge et al., Appl. Phys. Lett. 81, 4748 (2002)]. Si doping has been found to result in the formation of facetted grooves in the GaN films. The surface silicon concentration at the facets is determined to be about 2.5 times higher as compared to the planar (0001) surface by micro-spectroscopy. XSW results show that with increasing Mg dopant concentration, non-substitutional lattice sites are progressively occupied. The results can quantitatively be explained by Mg atoms incorporated in an anti-bixbyite-like structure and is related to inversion domain boundaries. For Si doping, no evidence is found for the occupation of non-substitutional sites. However, a decrease in crystal quality is observed with increasing Si concentration.X-ray photoemission micrograph of a Si doped GaN film showing a facetted groove at the lower left corner of the image. The local spectra (see inset) reveal Si enrichment at the facets.