In the document "prices.xml", find the minimum price for each book, in the
form of a minprice element with the book title as its 
title attribute.
<results>
 {
   FOR $t IN distinct(document("prices.xml")/book/title)
   LET $p := $doc/book[title = $t]/price
   RETURN
    <minprice title = { $t/text() } >
     { min($p) }
    </minprice>
 }
</results>
  Adapted from XML Query Use Cases