A RESTXQ module 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 directory specified by {{Mono|HTTPPATH}} (refer to [[BaseX Web Application#Configuring Database Access|HTTP Server Configuration]]) will be treated as RESTXQ modules. These will be parsed for RESTXQ annotations and cached. If a module is modified, it will be parsed again at runtime.
A simple RESTXQ module is shown below, it is part of a clean installation and available at http://localhost:8984/restxq/ .