Question on XPathNodeIterator MoveNext() in C#
I am parsing an Xml file. and I got a trouble on how to use `XPathNodeIterator` `MoveNext()` more reasonable in C#2.0.



My code as this,

    while (it.MoveNext())
    {
    
    
    string str = it.Current.GetAttribute("id", it.Current.NamespaceURI);
    
    it.Current.MoveToChild("item", "");
    
    // do someting....
    // My XMl file is a complex Xml file. I must Move to multi layer Child with *MoveToChild()*.
    // After that, I must add several *MoveToParent()* in different Layers to make sure the *it* still meet for the use of while loop.
    // I think it doesn't make sense like this.
    // Some time. the *it* can't still direct to my original layer. While-Loop doesn't work well.
    
    }

How can I fix this issue? Thanks for suggestions.
Question on XPathNodeIterator MoveNext() in C#
===

I am parsing an Xml file. and I got a trouble on how to use `XPathNodeIterator` `MoveNext()` more reasonable in C#2.0.



My code as this,

    while (it.MoveNext())
    {
    
    
    string str = it.Current.GetAttribute("id", it.Current.NamespaceURI);
    
    it.Current.MoveToChild("item", "");
    
    // do someting....
    // My XMl file is a complex Xml file. I must Move to multi layer Child with *MoveToChild()*.
    // After that, I must add several *MoveToParent()* in different Layers to make sure the *it* still meet for the use of while loop.
    // I think it doesn't make sense like this.
    // Some time. the *it* can't still direct to my original layer. While-Loop doesn't work well.
    
    }

How can I fix this issue? Thanks for suggestions.