code: def copy_node(node):
      
      element = node.makeelement(node.tag)
      element.text = node.text
      element.tail = node.tail
      for key, value in node.items():
          element.set(key, value)
  
      return element
docs: Makes a copy of a node with the same attributes and text, but no children.