title: Looping Through XML backwards using Javascript
body: <p>this is my first question on stack overflow, I hope you guys can help me.</p>
  
  <p>here is my xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;RecentPhotoUploads&gt;
  &lt;PHOTO&gt;&lt;SOURCE&gt;6171.jpg&lt;/SOURCE&gt;&lt;/PHOTO&gt;
  &lt;PHOTO&gt;&lt;SOURCE&gt;6173.jpg&lt;/SOURCE&gt;&lt;/PHOTO&gt;
  &lt;PHOTO&gt;&lt;SOURCE&gt;6895.jpg&lt;/SOURCE&gt;&lt;/PHOTO&gt;
  &lt;PHOTO&gt;&lt;SOURCE&gt;Tulips.jpg&lt;/SOURCE&gt;&lt;/PHOTO&gt;
  &lt;/RecentPhotoUploads&gt;
  </code></pre>
  
  <p>here is my javascript code</p>
  
  <pre><code>    var xml=loadXMLDoc("../upload.xml");
      var source="/RecentPhotoUploads/PHOTO/SOURCE"
  
      var nodes=xml.evaluate(source, xml, null, XPathResult.ANY_TYPE, null);
      var result=nodes.iterateNext();
  
  
                  while (result)
                  {
                  document.write("&lt;h2&gt;" + result.childNodes[0].nodeValue + "&lt;/h2&gt;");
                  document.write("&lt;a href='../pics/" + result.childNodes[0].nodeValue + "&lt;/a&gt;");
                  result=nodes.iterateNext();
                  }
  </code></pre>
  
  <p>How would I loop through this xpathresult backwards?</p>