ElementTree (and the faster compatible implementations in cElementTree
and lxml
) let you very easily extract information from XML -- as long as the XML is correct and your goals are well defined.
Your example XML has at least two problems (you're opening another dessert
tag instead of closing the first one, and you're missing any root element) and your goals are pretty mysterious to me (e.g., where's "text" supposed to come from?). If you edit your Q to fix your XML and clarify your exact specifications, I'm sure we can help you more.