title: Loop through a specific node of XML with XmlNodeList
body: <p>I have the following XML type file</p>
  
  <pre><code>&lt;root&gt;
  &lt;info version_id=... product_id=... account_id=...&gt;
  &lt;CRM&gt;
  &lt;result key=... value=...&gt;
  &lt;result key=... value=...&gt;
  ....
  &lt;/CRM&gt;
  &lt;result key=... value=....&gt;
  &lt;/info&gt;
  
  &lt;info version_id=... product_id=... account_id=...&gt;
  &lt;CRM&gt;
  &lt;result key=... value=...&gt;
  &lt;result key=... value=...&gt;
  ....
  &lt;/CRM&gt;
  &lt;result key=... value=....&gt;
  &lt;/info&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I need for each "info" nodes to create the following list:
  list(account+product, key, value)
  And I must take only "key" and "value" information that are part of the CRM node.</p>
  
  <p>So the close I want was with this code</p>
  
  <pre><code>string[] directoryXml = Directory.GetFiles(directory);
  var listxmlresult = new List&lt;XmlResultNode&gt;();
  
  foreach (var xmlfile in directoryXml)
  {
      var docxml = new XmlDocument();
      docxml.Load(xmlfile);
      XmlNodeList nodesInfo = docxml.SelectNodes("//info");
      XmlNodeList nodesResult = docxml.SelectNodes("//info/CRM/result");
  
  
      foreach (XmlNode info in nodesInfo)
      {
  
          string VersionId = info.Attributes["version_id"].Value;
          string ProductId = info.Attributes["product_id"].Value;
          string AccountId = info.Attributes["account_id"].Value;
          string AccountProductId = AccountId + " : " + ProductId;
  
  
          // verify that CRM node exist
  
          if (docxml.SelectSingleNode("//info/CRM") == null)
          {
              //To do log info that CRM node is not available for the specific file
          }
  
          foreach (XmlNode result in nodesResult)
          {
              //To do verfiy value is empty
  
              string Key = result.Attributes["key"].Value;
              string Value = result.Attributes["value"].Value;
  
              if (Value.Length != 0)
              {
                  var listXmlResultTemp = new XmlResultNode(AccountProductId, Key, Value);
                  listxmlresult.Add(listXmlResultTemp);
              }
          }
      }
  }
  </code></pre>
  
  <p>But this code return list with all "key" "value" for each  "accountproduct".</p>
  
  <p>I cannot manage in my second loop to just read the current  node.
  I tried several xpath possibility but I cannot manage to take the current position with XmlNodeList.</p>
  
  <p>Tks</p>