title: XmlDoc SelectNodes selecting entire document
body: <p>I have a simple XML doc with <strong><em>no Namespace</em></strong></p>
  
  <p>Here is the code I wrote in C# to search for a particular element based on <em>Name</em>. </p>
  
  <pre><code>public XmlElement SearchXML(string name)
      {
      XmlDocument xDoc = new XmlDocument();
      string filePath = ConfigurationManager.AppSettings["path"];
      xDoc.Load(filePath);
  
          string xQryStr = "//NewPatient[Name='" + name + "']";
          xDoc.SelectNodes(xQryStr);
  
          XmlElement xmlEle = xDoc.DocumentElement;
          return xmlEle;
      }
  </code></pre>
  
  <p>The XML document is as follows</p>
  
  <p><img src="https://i.stack.imgur.com/Zjy19.png" alt="Screenshot of XML file"></p>
  
  <p>When I try to call the method <em>SearchXML</em> and pass <em>Dennis</em> as the arguement, instead of returning the xml element containing only the specific elements, it returns the entire document.</p>
  
  <p>Where am I possibly erring?</p>
  
  <p>Any help appreciated.</p>