Hi Chris,
Just to be sure: Have you read my response to Luke, and have you thought about using RESTXQ and providing a single entry point (for the beginning) for queries that calls xquery:eval?
From the suggestions, it sounds like storing the queries as data within the database is the most likely solution in the current software.
You can also store your queries in the filesystem of your server. And you could add other endpoints to store and update your custom database queries.
XQuery is much more than a simple query language; you can use it to develop complex web applications. Did you already have a look at the DBA code that’s part of our distributions?
Best, Christian