Stripping atributos de espacio de nombres de python de un lxml.objectify.ObjectifiedElement [duplicado]
Posible duplicado:
Cuando se usa lxml, ¿se puede representar el XML sin atributos de espacio de nombres?
¿Cómo puedo quitar los atributos de Python de unalxml.objectify.ObjectifiedElement
?
Ejemplo
In [1]: from lxml import etree, objectify
In [2]: foo = objectify.Element("foo")
In [3]: foo.bar = "hi"
In [4]: foo.baz = 1
In [5]: foo.fritz = None
In [6]: print etree.tostring(foo, pretty_print=True)
<foo xmlns:py="http://codespeak.net/lxml/objectify/pytype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" py:pytype="TREE">
<bar py:pytype="str">hi</bar>
<baz py:pytype="int">1</baz>
<fritz xsi:nil="true"/>
</foo>
En cambio, me gustaría que la salida se vea así:
<foo>
<bar>hi</bar>
<baz>1</baz>
<fritz/>
</foo>