The XmlNode
is an Iterable<XmlNode>
over all its children.
If root
is the parsed root node of your XML tree you can write:
for (var node in root) {
if (node is XmlElement && node.name.local == 'importantData') {
// do something with the node
}
}
If you are more into functional programming, you can use the following expression returning an iterable over all elements in question:
root.where((node) => node is XmlElement && node.name.local == 'importantData')