The elemental ratio of a sample is determined by the ratios of the integrated areas of the peaks associated with individual elements. The area of each peak is corrected by a factor associated with the probability of an x-ray photon actually generating an emitted photoelectron. These photoelectron cross sections were originally calculated by Yeh and Lindau using Hartree-Fock-Slater methods in 1985 (http://www.sciencedirect.com/science/article/pii/0092640X85900166) and are almost universally used in XPS analysis. Very generally speaking, the more electrons an atom has, the bigger its cross section. Note that you need to find the cross section values specific to your spectrometer, as there are sometimes instrumental corrections included.
To give a simple example, if you have a survey spectrum with only 2 primary peaks associated with Li and O, you first find the area of each peak (total counts) after subtraction of a background count level. This gives you the ratio O(area)/Li(area). However, to convert this to an atomic ratio, have to correct for the fact that Li is almost transparent to the x-ray energies used in typical XPS machines and has a tiny cross section. Each area is corrected by dividing by the cross section, so that the atomic ratio is equal to (O(area)/Li(area))*(Li(cross section)/O(cross section)). If this number is close to 0.5, you're probably looking at Li2O, and if it's close to 1, then you've got either Li2O2 or LiOH (note that you can't detect H with XPS).
There are a number of other intricacies to this, depending on the complexity of peaks involved and the structure of the sample. XPS only detects the first few nanometers of material, and this analysis is ONLY truly quantitative under the assumption that the composition is homogeneous within the 3D analysis region (rarely true).
There are also many resources about this on the web, for instance http://mmrc.caltech.edu/SS_XPS/XPS_PPT/XPS_Slides.pdf
An accurate oxygen concentration that is free of any additional oxygen contribution from carbon species (such as when determining an oxygen:carbon ratio).
As all theory is written in the first answer, I can only add that the easiest way to do it is to use CasaXPS software. The demo version can be downloaded from internet and it will allow you to do all calculation you need. The manual also can be downloaded. If you have only survey spectra (low resolution scan covering entire region of binding energies) you need to insert several region inside, covering all elements (C, O, N, etc.) You also must know the relative sensitivity factors (RSF). They can be different for each machine, so contact the XPS engineer to provide you this data.
More information you can find in the guidebook by BeaMSON AND BRIGGS AND IN THE CASAXPS MANUAL.