Python ElementTree - iterate through child nodes and text in order
问题 I am using python the third and the ElementTree API. I have some xml of the form: <root> <item>Over the <ref id="river" /> and through the <ref id="woods" />.</item> <item>To Grandmother's <ref id="house" /> we go.</item> </root> I want to be able to iterate through the text and child nodes for a given item in order. So, for the first item, the list I want printed line by line would be: Over the <Element 'ref' at 0x######> and through the <Element 'ref' at 0x######> . But I can't figure out