title: Reading a XML File using XPath Expression in C#
body: <p>I am currently having a problem with reading a XML file using XPath expression. I have used the XmlDocument class. When I try reading a particular node from the XML, I get an empty list. The node which I am trying to read is the ID below ProductionRequest.</p>
  
  <p>Here is the XML file which I tried to read:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
  &lt;ProductionSchedule xmlns="http://www.wbf.org/xml/b2mml-v02"&gt; 
    &lt;ID&gt;00000020000000&lt;/ID&gt;
    &lt;Location&gt;
     &lt;EquipmentID&gt;8283&lt;/EquipmentID&gt;
     &lt;EquipmentElementLevel&gt;Site&lt;/EquipmentElementLevel&gt;
    &lt;Location&gt;
     &lt;EquipmentID&gt;0&lt;/EquipmentID&gt;
     &lt;EquipmentElementLevel&gt;Area&lt;/EquipmentElementLevel&gt;
     &lt;/Location&gt;
    &lt;/Location&gt;
   &lt;ProductionRequest&gt;
      &lt;ID&gt;0009300000000&lt;/ID&gt;
      &lt;ProductProductionRuleID&gt;W001&lt;/ProductProductionRuleID&gt;
      &lt;StartTime&gt;2017-04-20T23:57:20&lt;/StartTime&gt;
      &lt;EndTime&gt;2017-04-20T24:00:00&lt;/EndTime&gt;
      &lt;/ProductionRequest&gt;
    &lt;/ProductionSchedule&gt;
  </code></pre>
  
  <p>This is the code which I used to read the above XML</p>
  
  <pre><code>using System;
  using System.Xml.Linq;
  using System.Xml;
  using System.Xml.XPath;
  
  namespace XML
  {
    class Program
    {
      static void Main(string[] args)
      {
       Console.WriteLine("Hello World!");
       string fullName = "F:\\Programming\\XML\\Example XML.xml";
       XmlDocument xreader = new XmlDocument();
  
       xreader.Load(fullName);
       XmlNode root = xreader.DocumentElement;
       XmlNodeList xnList1 = 
              xreader.SelectNodes("/ProductionSchedule/ProductionRequest/ID");
  
  
      }
    }
   }
  </code></pre>
  
  <p>I could not find the cause for this problem. Could anyone help me in this regard. Looking forward for valuable inputs.</p>