We present the first successful attempt at calculating cluster full-potenti
al x-ray absorption near-edge structure (XANES) spectra, based on the finit
e difference method. By fitting XANES simulations onto experimental spectra
we are able to perform electron population analysis. The method is tested
in the case of Ti K-edge absorption spectrum in TiO2, where the amount of c
harge transfer between Ti and O atoms and of the screening charge on the ph
otoabsorber is obtained taking into account both dipolar and quadrupolar tr
ansitions.