|-
| '''Examples'''
|The following RESTXQ function XQuery can e.g. be called via <code><nowiki>http://localhost:8984/restxq/setquery.xq?key=user&value=john</nowiki></code>:
<pre class="brush:xquery">
module namespace test = 'http://basex.org/examples/test';
import module namespace session = "http://basex.org/modules/session";
declare %restxq:path("/set") %restxq:query-param("key", "{$key}", "") %restxq:query-param("value", "{$value}", "") function test:update($key, $value){ session:update-attribute($key, $value), 'Attribute was set.'};
</pre>
|}