def copy_of_xml_element(elem):

    copyElem = ElementTree.Element(elem.tag, elem.attrib)
    for child in elem:
        copyElem.append(child)
    return copyElem
This method returns a shallow copy of a XML-Element.
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/util.py/copy_of_xml_element