write_xml() should do the actual file writing