code: def iterparse(source, tag, clear=False, events=None):
      
      for event, elem in ElementTree.iterparse(source, events=events):
          if elem.tag == tag:
              yield elem
          if clear:
              elem.clear()
docs: iterparse variant that supports 'tag' parameter (like lxml),
      yields elements and clears nodes after parsing.