title: HtmlAgilityPack : Descendants vs Xpath
body: <p>Im working with the HtmlAgilityPack lib and having a few questions of understanding from my limited xpath knowledge. As the code sample below show, from immediate window, table is a htmlnode selected from DocumentNode. So with "/div" none is selected, "div" the one div child is selected, "//div" have selected all the divs in the document(so it did not find only its descendants. Therefor i have picked table.Descendants instead which give me the 5 divs i want. </p>
  
  <p>I would like to know, is using xpath with the selectNodes method faster then just using linq (table.Descendants.Select(n=>n.attribute["class"] == "someclass")) ect. </p>
  
  <p>And what is it i dont understand about xpath, why cant i select a specific elements descendants? </p>
  
  <pre><code>table.SelectNodes("/div");
  null
  table.SelectNodes("div")
  {HtmlAgilityPack.HtmlNodeCollection}
     _items: Count = 1
     _parentnode: null
     Count: 1
     IsReadOnly: false
  table.SelectNodes("//div")
  {HtmlAgilityPack.HtmlNodeCollection}
     _items: Count = 84
     _parentnode: null
     Count: 84
     IsReadOnly: false
     table.Descendants("div").ToArray()
  {HtmlAgilityPack.HtmlNode[5]}
     [0]: Name: "div"}
     [1]: Name: "div"}
     [2]: Name: "div"}
     [3]: Name: "div"}
     [4]: Name: "div"}
  </code></pre>