Theoretical treatment of X-ray absorption fine structure by the localized orbitals method