#!/usr/local/bin/python3 import xml.etree.ElementTree as etree from StringIO import StringIO i = etree.iterparse(StringIO('')) for e in i: print(e)