P and S K-edge XANES of transition-metal phosphates and sulfates