Am 07.01.2022 um 10:56 schrieb Hans-Juergen Rennau:
Phantastic, Martin - you made it work! Many thanks!

Could you help me fully understand the reason - so why exactly is
    %output:method("xhtml")

essential? I would have thought that the reason is fully given by the serialization details. But from what you wrote I gather there is a second reason, which is the content-type header which is set dependent on %output-method? After reading your post I also found in the BaseX documentation:

"The next function, when called, generates XHTML headers, and text/html will be set as content type:"


As far as I have understood the BaseX documentation for REST and RESTXQ, the default content response type for a GET request is application/xml, so for your GET where you want to return XHTML to be treated as text/html, you need to use one of the ways to ensure that the content response type is text/html, the easiest I have found is to add the

  %output:method("xhtml")

annotation.