Hi Markus,
XQuery scripts can be used also to compute values from selected XML data structures. Query results can be exported then into other file formats. But I would like to reuse query results for further queries directly.
One common approach is to create volatile database instances from from query results (databases in BaseX are prety lightweight).
How does your script look like?
Best, Christian