title: How to sort values via XPath
body: <p>These is my XML.</p>
  
  <pre><code>&lt;root&gt;
  
  &lt;element&gt;
  &lt;title&gt;Title .. &lt;/title&gt;
  &lt;val&gt;2&lt;/val&gt;
  &lt;date&gt;21/01/2011&lt;/date&gt;
  &lt;/element&gt;
  
  &lt;element&gt;
  &lt;title&gt;Title .. &lt;/title&gt;
  &lt;val&gt;1&lt;/val&gt;
  &lt;date&gt;21/01/2011&lt;/date&gt;
  &lt;/element&gt;
  
  &lt;element&gt;
  &lt;title&gt;Title .. &lt;/title&gt;
  &lt;val&gt;2&lt;/val&gt;
  &lt;date&gt;22/01/2011&lt;/date&gt;
  &lt;/element&gt;
  
  &lt;/root&gt;
  </code></pre>
  
  <p>The logic is this:
  Element nodes should be ranked according to node val and date. First Order must be based on val and within this sequence of nodes with val value. They should be listed by date.</p>
  
  <p>Does anyone know how to get a sorted list of XML nodes via XPath? </p>
  
  <p>Any ideas?</p>