=Module Declarations=
A RESTXQ module must needs to contain a declaration to the namespace {{Mono|http://exquery.org/ns/restxq}}. A ''Resource Function'' is an XQuery function that has been marked up with RESTXQ annotations (annotations will be introduced with the upcoming [[XQuery 3.0]] standard). When an HTTP request comes in, a resource function will be invoked that matches the constraints indicated by its annotations. All files with extension {{Mono|*.xqm}}, placed inside the {{Mono|HTTPPATH}} (refer to [[BaseX Web Application|HTTP Server Configuration]]) will be treated as RESTXQ modules. These will searched for matching RESTXQ annotations on each HTTP request.
A simple RESTXQ module is shown below: