There’s one caveat for iterating over xml.etree elements in python. Although the following code works on iterators – just like in C++ – the code sliently fails in checking consecutive children of the element being iterated over import xml.etree.ElementTree as ET xml = ET.parse('filename.xml') root = xml.getroot() for elem in […]