Exploring the atomic and electronic structures of low thermal conductivity materials using a combined XAS and DFT approach