I recently used David Mertz's Gnosis utilities to generate XML from a Python object holding some maps. 1 line of code was all it took to generate the XML and the library also uses a deep copy flag to provide optimizations to cross reference repeating values rather than explicitly recreating them each time. I didn't put these libraries through any sort of rigorous testing but for ease of use they score big with me.