import xml.etree.ElementTree as ET
tree=ET.parse('xml.xml')
root=tree.getroot()
data=ET.Element('yml_catalog')
offer=ET.SubElement(data,'offer')
name=ET.SubElenent(offer,'name')
name.text='имя abc'
ET.ElementTree(data).write("xml.xml")
ET.ElementTree(data).write("xml.xml")
<yml_catalog><offer><name>имя abc</name></offer></yml_catalog>
ET.ElementTree(data).write("xml.xml", encoding='UTF-8')
<yml_catalog><offer><name>имя abc</name></offer></yml_catalog>