X-ray photoelectron spectroscopy (XPS) is used for elemental identification and quantification in a number of fields, and the optimization of XPS performance can help in making better use of the limited XPS tool availability. In the field of extreme ultraviolet (EUV) lithography, one of the requirements is having a clean vacuum environment to minimize contamination of the EUV optics. EUV resist outgassing is viewed as one of the main issues that could affect the vacuum environment. There is a program underway to measure the relative contamination rates from different resists following the ASML (provider of lithography systems) approved protocols for witness plate testing. One of the key steps is the XPS measurement of residue on the optics after cleaning. The role of XPS in quantification of species that adhere to the ruthenium-coated silicon witness plate sample is discussed. The various XPS tool parameters like the pass energy and source setting were optimized for our application of witness plate analysis. The statistics of our XPS tool were studied, and combined with the fundamental XPS equations, a simple mathematical model was developed to optimize the number of scans for the various elements of interest in our witness plate study. Using the optimized number of scans, the acquisition time to measure the contaminant elements to a precision better than 0.1 at.% was minimized. The model devised in the paper can be adapted to other XPS measurements requiring different levels of precision.