title: Java: how to locate an element via xpath string on org.w3c.dom.document
body: <p>How do you quickly locate element/elements via xpath string on a given org.w3c.dom.document? there seems to be no <code>FindElementsByXpath()</code> method. For example</p>
  
  <pre><code>/html/body/p/div[3]/a
  </code></pre>
  
  <p>I found that recursively iterating through all the child node levels to be quite slow when there are lot of elements of same name. Any suggestions?</p>
  
  <p>I cannot use any parser or library, must work with w3c dom document only.</p>