; Examples
* Return the first five city names of the <b>factbook</b> database:
<syntaxhighlight lang="xml">
<rest xmlns="http://basex.org/rest">
</syntaxhighlight>
* Return string lengths of all text nodes that are found in the node that has been specified as initial context node:
<syntaxhighlight lang="xml">
<query>
</syntaxhighlight>
* Return the registered database users encoded in <code>ISO-8859-1</code>:
<syntaxhighlight lang="xml">
<command>
</syntaxhighlight>
* Create a new database from the specified input and preserve all whitespaces:
<syntaxhighlight lang="xml">
<command>
</syntaxhighlight>
* Bind value to the {{Code|$person}} variable and run query <code>find-person.xq</code>:
<syntaxhighlight lang="xml">
<run>