How to itterate all child elements in a XMLElement

i try to load a XML file and i want to itterate all of its elements to do something with them and i tried to do it like this:

for (XMLElement element = source.NextResult(); element.NotNull(); element = element.NextResult())

but it doesnt itterate anything and i have seen some XPathResult but i dont know how to use it.

I suppose that you have no result because you have no query to iterate.
Use NextChild to iterate over elements witout query.

Hm… shouldn’t this method actually be called NextSibling? :confused:

I mis-recalled the name /_-
It was GetNext.

1 Like