Element selectivity and possibilities for in situ and operando applications make X-ray absorption spectroscopy a powerful tool for structural characterization of catalysts. While determination of coordination numbers and interatomic distances from extended spectral region is rather straightforward, analysis of X-ray absorption near-edge structure (XANES) spectra remains a highly debated and topical problem. The latter region of spectra is shaped depending on the local 3D geometry and electronic structure. However, there is no straightforward procedure for the unambiguous extraction of these parameters. This work gives a critical vision on the amount of information that can be practically extracted from Pd K-edge XANES spectra measured under in situ and operando conditions, in which adsorption of reactive molecules at the surface of palladium with further formation of subsurface and bulk palladium carbides are expected. We investigate how particle size, concentration of carbon impurities, and their distribution in the bulk and at the surface of palladium particles affect Pd K-edge XANES features and to which extend they should be implemented in the theoretical model to adequately reproduce experimental data. Then, we show how the step-by-step increasing the complexity of the theoretical model improves the agreement with experiment. Finally, we suggest a set of formal descriptors relevant to possible structural diversity and construct a library of theoretical spectra for machine-learning-based analysis of the experimental data.