bug fix: to_xml should now return valid XML.