metadata = '/Users/user1/Desktop/Python/metadata.xml'
parser = etree.XMLParser(remove_blank_text=True)
tree = etree.parse(metadata, parser)
root = tree.getroot()
for elem in root.getiterator():
    if not hasattr(elem.tag, 'find'):
        continue
i = elem.tag.find('}')
if i >= 0:
    elem.tag = elem.tag[i + 1:]
objectify.deannotate(root, cleanup_namespaces=True)
tree.write('/Users/user1/Desktop/Python/done.xml', pretty_print=True,
    xml_declaration=True, encoding='UTF-8')
Remove namespace and prefix from xml in python using lxml