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>
This is not well-formed XML!
Adapted from XML Query Use Cases