About as simple as it should get:
<state name = "foo1>
<foobar item1="something1" item2="somethingelse1" item3="usefulitem1"/>
<foobar item1="something2" item2="somethingelse2" item3="usefulitem2"/>
<state name = "foo2">
...
root = lxml.etree.parse(fileName)
path = "./*[contains(text(),'useful')]"
someElement = root.xpath(path)
I'm trying to make a list of all the foobar's that have some item with the text 'useful' somewhere in it. I keep getting the error TypeError: 'lxml.etree._ElementTree' object is not iterable