Methylviologen-templated layered bimetal phosphate: a multifunctional X-ray-induced photochromic material.