Analysis of the detailed configuration of hydrated lanthanoid(III) ions in aqueous solution and crystalline salts by using K- and L(3)-edge XANES spectroscopy.