title: Recursively select children node using XPath recursively?
body: <p>Given the following XML:</p>
  
  <pre><code>&lt;Checks&gt;
     &lt;IsSomethingCheck Param="1"/&gt;
     &lt;IsSomeoneCheck Param2="2"/&gt;
     &lt;Checks Operator="Or"&gt;
         &lt;IsAnythingCheck Param3="3"/&gt;
     &lt;/Checks&gt;
  &lt;/Checks&gt;
  </code></pre>
  
  <p>How would I traverse the children of <code>Checks</code> element recursively?</p>
  
  <p>The code below works for the outermost children but stops processing the inner most children (Part of the inner <code>Checks</code> element)</p>
  
  <pre><code>protected override void InitializePlugin(XmlElement xmlElement)
  {
      Enum.TryParse(xmlElement.GetAttribute("Operator"), out _operator);
  
      XPathNodeIterator nav = xmlElement.CreateNavigator().Select("Checks/*");
  
      foreach (XPathNavigator checkNode in nav)
      {
          if (_checksLookup.ContainsKey(checkNode.Name))
          {
              Type checkType = _checksLookup[checkNode.Name];
              Check check = Activator.CreateInstance(checkType) as Check;
              check.Initialize(checkNode.OuterXml);
              Checks.Add(check);
          }
      }    
  }
  </code></pre>
  
  <p>PS: The XmlElement of this method expects that it will receive the entire <code>Checks</code> section of the XML.</p>