def remove_namespaces(root):
for elem in root.getiterator():<EOL><INDENT>if not hasattr(elem.tag, '<STR_LIT>'):<EOL><INDENT>continue<EOL><DEDENT>i = elem.tag.find('<STR_LIT:}>')<EOL>if i >= <NUM_LIT:0>:<EOL><INDENT>elem.tag = elem.tag[i + <NUM_LIT:1>:]<EOL><DEDENT><DEDENT>objectify.deannotate(root, cleanup_namespaces=True)<EOL>
Call this on an lxml.etree document to remove all namespaces