title: C# Xpath only returning first element
body: <p>I am using HTMLAgilityPack to read and load an XML file.  After the file is loaded, I want to insert the values from it into a database.</p>
  
  <p>XML looks like this:</p>
  
  <pre><code> &lt;meeting&gt;
         &lt;jobname&gt;&lt;/jobname&gt;
         &lt;jobexperience&gt;&lt;/jobexperience&gt;
   &lt;/meeting&gt;   
  </code></pre>
  
  <p>I'm trying to accomplish this using XPath statements within a foreach loop as seen here:</p>
  
  <pre><code>DataTable dt = new DataTable();
  //Add Data Columns here
  dt.Columns.Add("JobName");
  dt.Columns.Add("JobExperience");
  
  // Create a string to read the XML tag "job"
  string xPath_job = "//job";
  string xPath_job_experience = "//jobexperience";
  
  
  /* Use a ForEach loop to go through all 'meeting' tags and get the values
     from the 'JobName' and 'JobExperience' tags */  
  
  foreach (HtmlNode planned_meeting in doc.DocumentNode.SelectNodes("//meeting"))
  {
      DataRow dr = dt.NewRow();
  
      dr["JobName"] = planned_meeting.SelectSingleNode(xPath_job).InnerText;
  
      dr["JobName"] = planned_meeting.SelectSingleNode(xPath_job_experience).InnerText;
  
      dt.Rows.Add(dr);
  
  }     
  </code></pre>
  
  <p>So the problem is that even though the foreach loop is going through every 'meeting' tag, it's getting the values from only the first 'meeting' tag.</p>
  
  <p>Any help would be greatly appreciated!</p>