Python schematics models for converting to and from XML.
pip install schematics-xml
Simply inherit XMLModel.
from schematics_xml import XMLModel
class Person(XMLModel):
name = StringType()
john = Person(dict(name='John'))
xml = john.to_xml()
XML now contains;
<?xml version='1.0' encoding='UTF-8'?>
<person>
<name>John</name>
</person>
And back the other way;
john = Person.from_xml(xml)
Alex Hayes <alex@alution.com>