title: How to select a node using XPathNavigator.SelectSingleNode(string xpath)?
body: <p>I have this xml file "target.xml":</p>
  
  <pre><code>&lt;World&gt;
    &lt;Nkvavn&gt;
      &lt;Rcltwkb&gt;
        &lt;Pjwrgsik /&gt;
        &lt;Nemscmll /&gt;
        &lt;Fnauarnbvw /&gt;
        &lt;Egqpcerhjgq /&gt;
        &lt;Olyhryyxi /&gt;
        &lt;Vvlhtiee /&gt;
        &lt;Wlsfhmv /&gt;
      &lt;/Rcltwkb&gt;
      &lt;Xudbhnakjb&gt;
        &lt;Cwxjtkteuji /&gt;
        &lt;Fbtcvf /&gt;
        &lt;Uviaceinhl /&gt;
      &lt;/Xudbhnakjb&gt;
      &lt;Kgujcymilwr&gt;
        &lt;Nlbvgtwoejo /&gt;
        &lt;Tvufkvmryybh /&gt;
        &lt;Xtomstcenmp /&gt;
        &lt;Mhnngf /&gt;
        &lt;Fjidqdbafxun /&gt;
      &lt;/Kgujcymilwr&gt;
      &lt;Taiyiclo&gt;
        &lt;Fiecxoxeste /&gt;
        &lt;Loqxjq /&gt;
        &lt;Vfsxfilxofe /&gt;
        &lt;Hroctladlht /&gt;
      &lt;/Taiyiclo&gt;
    &lt;/Nkvavn&gt;
    &lt;Tfrosh&gt;
      &lt;Tuqomkytlp&gt;
        &lt;Oyvivlvminhn /&gt;
        &lt;Qeypvfgul /&gt;
        &lt;Mbapjl /&gt;
      &lt;/Tuqomkytlp&gt;
      &lt;Rvxumtj&gt;
        &lt;Gkvigncdvgy /&gt;
        &lt;Okcddyi /&gt;
        &lt;Vvmacul /&gt;
      &lt;/Rvxumtj&gt;
      &lt;Pdjpgexuyc&gt;
        &lt;Yvsdmbckurju /&gt;
        &lt;Bvkxvg /&gt;
        &lt;Clmrvjwk /&gt;
        &lt;Hdafjhydj /&gt;
        &lt;Asauxtnoe /&gt;
        &lt;Mwcviwmi /&gt;
      &lt;/Pdjpgexuyc&gt;
    &lt;/Tfrosh&gt;
  &lt;/World&gt;
  </code></pre>
  
  <p>In the method BindCities(string country) i am trying to get to the country element () but the nav variable doesn't change it's value to the country element after running the code, it just stays at the last location. I tried a lot of methods but nothing worked.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Windows.Forms;
  using System.Xml;
  using System.Xml.XPath;
  
  namespace MultipleBoundListBox
  {
      public partial class Form1 : Form
      {
          private static XmlDocument xmlDoc;
          private static XPathNavigator nav;
  
          public Form1()
          {
              InitializeComponent();
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
              xmlDoc = new XmlDocument();
              xmlDoc.Load(@"target.xml");
  
              nav = xmlDoc.DocumentElement.CreateNavigator();
  
              nav.MoveToFirstChild();
              var countries = new List&lt;string&gt;();
              countries.Add(nav.LocalName);
  
              while (nav.MoveToNext())
              {
                  countries.Add(nav.LocalName);
              }
  
              listBox1.DataSource = countries;
  
              BindCities(countries[0]);
          }
  
          protected void BindCities(string country)
          {
              nav.MoveToRoot();
              var xpath = "//" + country;
              nav.SelectSingleNode(xpath);
              nav.MoveToFirstChild();
  
              var cities = new List&lt;string&gt;();
              cities.Add(nav.LocalName);
  
              while (nav.MoveToNext())
              {
                  cities.Add(nav.LocalName);
              }
  
              listBox2.DataSource = cities;
          }
      }
  }
  </code></pre>
  
  <p>What code do i need to reach the country element with the nav XPathNavigator?</p>
  
  <p>Thanks for your replies!</p>