2010/8/20 Leonard Wörteler <leonard.woerteler@uni-konstanz.de>

Wouldn't be the simplest solution to your problem to replace the
characters '{' and '}' in the serialized XML string with their character
entities ("&#x7B;" and "&#x7D;" respectively)? I can't think of
situations when it would destroy the markup and the parsing process
converts them back either way.


Alright, I'll try that. The cdata-section-element approach (either on the Java-side via setOutputProperty or in the XQuery via declare option) would be cleaner in my opinion, but the apparent absence of a "all elements" option would require that one lists all elements whose character data is escaped in this way.

 - Godmar