from xml.dom.minidom import Document
from xml.dom import minidom
file1=modificare.xml
file2=sorgente.xml
xmldoc=minidom.parse(file1)
for Node in xmldoc.getElementsByTagName("Sampler"):
# put in the file2 content
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
# Configure one attribute with set()
root = Element('opml')
root.set('version', '1.0')
root.append(Comment('Generated by ElementTree_csv_to_xml.py for PyMOTW'))