To effectively replace the isotope radiation source in litho-density logging, this study presents a method for measuring the formation density and photoelectric absorption index (Pe) using a switchable X-ray tube. First, the gamma-ray litho-density logging (GLD) method for measuring formation density and Pe using chemical sources is introduced. Then, a benchmark verification based on the X-ray litho-density logging tool prototype and data published by Simon (In: Paper presented at the SPWLA 59th annual logging symposium, London, UK, 2018) was carried out using Monte Carlo numerical simulations. Second, the impacts of the photoelectric effect and detector statistical error on the GLD method were analyzed. Finally, based on a theoretical analysis, the formation density and Pe measurement algorithm (double energy window (DEW) method) was improved, which was found to be suitable for X-ray litho-density logging. Moreover, the results obtained using this algorithm were compared with those obtained using the GLD method. The results indicate that owing to the impact of photoelectric effect and detector statistical error on the density energy window, the accuracy of formation density and Pe measurement using the GLD method is relatively low, with the uncertainty in formation density and Pe measurement reaching 2.620 ± 0.047 g/cm3 and 4.090 ± 0.580 b/e, respectively. In comparison, the DEW method can improve the accuracy of density and Pe measurement to 0.006 g/cm3 and 0.065 b/e, respectively, as the photoelectric effect in the density window is corrected using the counts in the lithology window of the energy spectrum. This study aims to provide a new theoretical foundation for processing X-ray litho-density logs in the future.