|-
| '''Examples'''
|* The query <code><nowiki>web:redirect('/a/b')</nowiki></code> returns the following response elementresult (which will be interpreted as redirection if RESTXQ is used):
<pre class="brush:xml">
<rest:response xmlns:rest="http://exquery.org/ns/restxq">
</http:response>
</rest:response>
</pre>
* The first RESTXQ function creates an initial database, and redirects to a second function that will access this database:
<pre class="brush:xquery">
declare %updating %rest:path('/app/init') function local:init() {
db:create('app', <root/>, 'root.xml'),
db:output(web:redirect('/app/main'))
};
declare %rest:path('/app/main') function local:update() {
'Stored documents: ' || count(db:open('app'))
};
</pre>
|}