There's also the excellent 3rd party library pyxser for Python.
pyxser stands for Python XML
Serialization and is a Python object
to XML serializer and deserializer. In
other words, it can convert a Python
object into XML and also, convert that
XML back into the original Python
object.