added fix xml_write