search/replace content of xml
I've been successful using xml.etree.ElementTree to parse an xml, search for content, then write this to a different xml. However, I just worked with text, inside of a singe tag. import os, sys, glob, xml.etree.ElementTree as ET path = r"G:\\63D RRC GIS Data\\metadata\\general\\2010_contract" for fn in os.listdir(path): filepaths = glob.glob(path + os.sep + fn + os.sep + "*overall.xml") for filepath in filepaths: (pa, filename) = os.path.split(filepath) ####use this section to grab element text from old, archived metadata files; this text then gets put into current, working .xml### root = ET