The current way to do this is transform your request via XQuery and the XSLT module. We may add a parameter for XSLT transformations to our REST API [4]; details would first have to be specified, though.
Yes, it can also be done in Java. The most compact solution I get in mind is:
1. Create a database X with your XML and XSLT file (called "example" in the following) 2. Go to your browser and visit http://localhost:8984/rest/X/example.xml?query=xslt:transform(.,db:open(.,%2...'))"
If we added an additional xslt parameter, the URL could look as follows:
http://localhost:8984/rest/X/example.xml?xslt=example.xslt
C.