def strip_ns(xml, ns):
 it = ET.iterparse(StringIO(xml))
 ns_prefix = ('{%s}' % XMLNS)
 for (_, el) in it:
  if el.tag.startswith(ns_prefix):
   el.tag = el.tag[len(ns_prefix):]
 return it.root

def strip_ns ( xml , ns ) : it = ET . iterparse ( StringIO ( xml ) ) ns_prefix = ( '{%s}' % XMLNS ) for ( _ , el ) in it : if el . tag . startswith ( ns_prefix ) : el . tag = el . tag [ len ( ns_prefix ) : ] return it . root
strip the provided name from tag names .