Ukázka zdrojového dokumentu, XQuery dotazů nad nimi a jejich výsledku.
Příklad 1. Zdrojový dokument
<?xml version="1.0" encoding="Windows-1250"?>
<addressbook>
<person category="friends">
<firstname>Petr</firstname>
<lastname>Novák</lastname>
<date-of-birth>1969-05-14</date-of-birth>
<email>novak@myfriends.com</email>
<characteristics lang="en">Very good friend</characteristics>
</person>
<person category="friends">
<firstname>Jaroslav</firstname>
<lastname>Nováèek</lastname>
<date-of-birth>1968-06-14</date-of-birth>
<email>novacek@myfriends.com</email>
<characteristics lang="en">Another good friend</characteristics>
</person>
<person category="staff">
<firstname>Jan</firstname>
<lastname>Horák</lastname>
<date-of-birth>1970-02-01</date-of-birth>
<email>horak@mycompany.com</email>
<characteristics lang="en">Just colleague</characteristics>
</person>
<person category="friends">
<firstname>Erich</firstname>
<lastname>Polák</lastname>
<date-of-birth>1980-02-28</date-of-birth>
<email>erich@myfriends.com</email>
<characteristics lang="en">Good friend</characteristics>
</person>
</addressbook>