I'm getting the following error when attempting to remove an element from the xml document. "ValueError: list.remove(x): x not in list" Here is the code, the error occurs on the line with the remove.
import xml.etree.ElementTree as ET
tree = ET.parse("AddInClasses.xml")
rootElem = tree.getroot()
for class2 in rootElem.findall("Transforms/class"):
name2 = class2.find("name")
if name2.text == "Get Field":
rootElem.remove(class2)
tree.write("AddInClassesTrimmed.xml")