def clone_into(parent, elem):
 clone = parent.makeelement(elem.tag)
 parent.append(clone)
 if (elem.text and (not elem.text.isspace())):
  clone.text = elem.text
 if (elem.tail and (not elem.tail.isspace())):
  clone.tail = elem.tail
 clone.attrib.update(elem.attrib)
 for child in elem.iterchildren(etree.Element):
  clone_into(clone, child)

def clone_into ( parent , elem ) : clone = parent . makeelement ( elem . tag ) parent . append ( clone ) if ( elem . text and ( not elem . text . isspace ( ) ) ) : clone . text = elem . text if ( elem . tail and ( not elem . tail . isspace ( ) ) ) : clone . tail = elem . tail clone . attrib . update ( elem . attrib ) for child in elem . iterchildren ( etree . Element ) : clone_into ( clone , child )
clone the element .