With stanzas like
for event, n in ElementTree.iterparse(xmlfile, events=("end",)): if n.tag == "blar": # do stuff n.clear()
With stanzas like
it doesn't even take much memory to parse files of arbitrary size.