A XANES study on the dehydration process of magnesium hydroxide