=Usage=
Since {{Version|7.7}}, the The RESTXQ service is by default available via {{Code|http://localhost:8984/}} (before: <code><nowiki>http://localhost:8984/restxq</nowiki></code>).
All RESTXQ [[XQuery 3.0#Annotations|annotations]] are assigned to the {{Code|<nowiki>http://exquery.org/ns/restxq</nowiki>}} namespace, which is statically bound to the {{Code|rest}} prefix (before {{Version|7.7}}: {{Code|restxq}}). A ''Resource Function'' is an XQuery function that has been marked up with RESTXQ annotations. When an HTTP request comes in, a resource function will be invoked that matches the constraints indicated by its annotations.
Whenever a RESTXQ URL is requested, the [[Options#RESTXQPATH|RESTXQPATH]] module directory and its sub-directories will be parsed for functions with RESTXQ annotations in library modules (detected by the extension {{Code|.xqm}}) and functions with RESTXQ annotations. Since {{Version|7.7}}, also main modules (detected by {{Code|.xq}}) will be parsed; the . In main expression of expressions, the main module will never be evaluated. All modules will be cached and parsed again when their timestamp changes.
A simple RESTXQ module is shown below. It is part of a clean installation and available at http://localhost:8984/ .