List books published by Addison-Wesley after 1993, including their year and title:
<bib>
{
for $b in document("bib.xml")/bib/book
where $b/publisher = "Addison-Wesley" and $b/@year > 1993
return
<book year ="{ $b/@year }">
{ $b/title }
</book>
}
</bib>
Adapted from XML Query Use Cases