Thanks for the suggestions. I agree that XML whitespace handling will always be a challenge and challenging to grasp… No matter what defaults are used in an implementation. It’s true, our documentation could provide more detail about this; maybe we can spend more time on that in the future. All edits are welcome ;)

I had a look at what Saxon does [2] (item 32). It looks like the Saxon boundary-space default is preserve.

I believe that Saxon strips boundary space by default as well. At least that’s my command-line experience (I didn’t check how that correlates to the information given in their documentation):

(: query.xq :)
<x> </x>

(: call :)
java -cp "saxon-he-12.2.jar;xmlresolver-5.1.1.jar" net.sf.saxon.Query query.xq

(: result :)
<?xml version="1.0" encoding="UTF-8"?><x/>

Best,
Christian