add write_xml tests