How much do you care that the display for the item “Query” would be equivalent to the original XQuery script (including special characters like line breaks)?
Not at all.
Interesting.
U+000A LINE FEED is one of three control characters allowed in XML.
I would occasionally like to work with multi-line information which will be provided by data structures that are not XML formats.
It's inherently special, but it's also white space, and white space is not important.
Can any more special characters become relevant for further data processing?
The query itself is not in and must not be in a presentation format where white space has semantic meaning.
The presentation variant “Optimized Query” can preserve mentioned details.
I've been doing mostly document-representation XML processing for twenty-odd years now.
Thanks for such background information.
There is no business case for pretty, stable indents, or semantic white space in XML or XQuery.
I got other impressions and expectations for some use cases.
Regards, Markus