See the question and my original answer on StackOverflow

Html Agility Pack only concentrates on markup. It has no idea of how things will be rendered. Firebug I think relies on the current in-firefox-memory DOM which can be dramatically different. That's why you see elements such as TBODY that only exist in DOM, not in markup (where they are optional).

Plus you can add to that the fact that there is an infinite possible XPATH expression for a given Xml node.

Anyway, in general, the needed XPATH when doing queries using Html Agility Pack don't need the full XPATH expression that a tool would give. You just need to focus on discriminants, for example specific attributes (like the class), id, etc.... Your code will be much more resistant to changes. But it means you need to learn a bit about XPATH (this is a good starting point: XPath Tutorial). So you really want to build XPATH expression such as this:

//div[@class = 'ABC']

which will get all DIV elements with a CLASS attribute named 'ABC'.