I would prefer to avoid the creation of another BaseX database for each query result.
Just fine as well. If you use XQuery, you can bind your query results to variables for further processing.
I guess that it is expected that this kind of query result binding would work only with XML data structures. Can any XQuery scripts be referenced by known file names at such places?
Regards, Markus