Hello,
Out of curiosity, is there a more compact way to check if an element
exists, edit if it does, insert if it doesn't ?
#=========== Edit/insert top-most name
r = root.find('./Document/name')
#if et.iselement(r)
if r is not None:
print("Name exists: ",r.text)
r.text = BASENAME
else:
print("Name does not exist")
#insert new element
et.SubElement('/kml/Document', "name").text = BASENAME
Thank you.