Removed some dead code
Updated to use new to_xml_file() for exporting output