A general framework is presented for the quantitative analysis of surfaces by X-ray photoelectron spectroscopy (XPS or ESCA). The approach starts by considering analysis using reference data recorded on the same instrument and under identical conditions as the analysed sample. Matrix factors are evaluated and the quantification for adsorbed layers and sputter profiles discussed. More popularly reference data are not recorded each time but are taken from the published literature. In this case the angular anisotropy term and analyser transmission functions need to be known. These are discussed and the analyser transfer functions of commercial spectrometers are presented in detail. Nine published reference data sets are assessed to test their correlation with the theoretical predictions. Theree sets are found to give moderate agreement but agree more closely with each other in their divergence from the theory for particular elements. This divergence enables a peak intensity factor to be defined which quantifies the intensity lost from a peak due to shake-up events, etc. With this factor and the analyser transfer functions quantification can be made to an accuracy of 10% in all instruments from a single reference data set.