def remove_namespace(doc, namespace):
<EOL>ns = '<STR_LIT>'.format(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><DEDENT><DEDENT>return doc<EOL>
Takes in a ElementTree object and namespace value.  The length of that
namespace value is removed from all Element nodes within the document.
This effectively removes the namespace from that document.

:param doc: lxml.etree
:param namespace: Namespace that needs to be removed.
:return: Returns the source document with namespaces removed.