programing xpath evaluate function java
<p>There is a problem in java with the XPath evaluate function. This function returns the NodeList in the original XML document order, but i want to get the NODES in it's original order.</p>

<p>For example:</p>

<pre><code>Object result2 = 
xpath.evaluate("/inventory/book[3]/precedingsibling::book",doc,XPathConstants.NODESET);
</code></pre>

<p>The result should be: book 2 and then book 1.</p>

<p>But the result I'm getting with evaluate is: book 1 and then book 2.</p>
