The XMLSerializer class is accessible via the kid module.
{'http://purl.org/atom/ns#': 'atom',
'http://purl.org/rss/1.0/': 'rss',
'http://www.w3.org/1999/02/22-rdf-syntax-ns#': 'rdf',
'http://www.w3.org/1999/xhtml': 'html',
'http://www.w3.org/XML/1998/namespace': 'xml'}
Initialize XMLSerializer.
You can change the following parameters:
encoding: the output encoding decl: add xml declaration at the beginning (True/False) doctype: add doctype (None, string, tuple) entity_map: use named entities for output (True/False or mapping) namespaces: mapping of namespaces formatted: whether all tags should be considered formatted inline: whether all tags should be considered inline format: format to be applied (string or instance of Format)
See the source for more information.