def remove_namespace(doc, namespace):
ns = u'<STR_LIT>' % namespace<EOL>nsl = len(ns)<EOL>for elem in doc.getiterator():<EOL><INDENT>if elem.tag.startswith(ns):<EOL><INDENT>elem.tag = elem.tag[nsl:]<EOL>elem.attrib['<STR_LIT>'] = namespace<EOL><DEDENT><DEDENT>
Remove namespace in the passed document in place.