title: Different * selection strategies in XPath
body: <p>What are the differences between the following approaches to target leaf nodes of a document based on some criteria?</p>
  <pre><code>&lt;!-- using //* --&gt;
  //*[contains(@class, &quot;w4&quot;)]       
  
  &lt;!-- using //node() --&gt;
  //node()[contains(@class, &quot;w4&quot;)]
  
  &lt;!-- using //. --&gt;
  //.[contains(@class, &quot;w4&quot;)]
  </code></pre>
  <p>All three of these 'work' to select the same node in some example xml, so I was wondering what if any difference there is between them, and if they're all the same, which is preferred (also why can't I just use <code>//[contains(@class, &quot;w4&quot;)]</code> with an empty node, wouldn't <code>//</code> imply anywhere from the root node?).</p>