def stripNameSpace(xml):
 r = re.compile('^(<?[^>]+?>\\s*)(<\\w+) xmlns=[\'"](http://[^\'"]+)[\'"](.*)', re.MULTILINE)
 if r.match(xml):
  xmlns = r.match(xml).groups()[2]
  xml = r.sub('\\1\\2\\4', xml)
 else:
  xmlns = None
 return (xml, xmlns)

def stripNameSpace ( xml ) : r = re . compile ( '^(<?[^>]+?>\\s*)(<\\w+) xmlns=[\'"](http://[^\'"]+)[\'"](.*)' , re . MULTILINE ) if r . match ( xml ) : xmlns = r . match ( xml ) . groups ( ) [ 2 ] xml = r . sub ( '\\1\\2\\4' , xml ) else : xmlns = None return ( xml , xmlns )
removenamespace -- remove top-level aws namespace .