XML file rewrite