title: How do I find a XML node by path in Linq-to-XML
body: <p>If I get the path to a specific node as a string can I somehow easily find said node by using Linq/Method of the XElement ( or XDocument ).</p>
  
  <p>There are so many different types of XML objects it would also be nice if as a added bonus you could point me to a guide on why/how to use different types.</p>
  
  <p>EDIT: Ok after being pointed towards XPathSelectElement I'm trying it out so I can give him the right answer I can't quite get it to work though. This is the XML I'm trying out</p>
  
  <pre><code>&lt;Product&gt;
    &lt;Name&gt;SomeName&lt;/Name&gt;
    &lt;Type&gt;SomeType&lt;/Type&gt;
    &lt;Quantity&gt;Alot&lt;/Quantity&gt;
  &lt;/Product&gt;
  </code></pre>
  
  <p>and my code</p>
  
  <pre><code>string path = "Product/Name";
  string name = xml.XPathSelectElement(path).Value;
  </code></pre>
  
  <p>note my string is coming from elsewhere so I guess it doesn't have to be literal ( at least in debug mode it looks like the one above). I've also tried adding / in front. It gives me a null ref.</p>