I have some text in a node, for example:
<?xml version='1.0' encoding='utf-8'?>
<xml><Hello world "&" foo bar></xml>
I would like to process /xml/string()
and output:
"<Hello world "&" foo bar>"
How can I do it with XPath 3.1?
REMARK: The question is more general than just JSON-escaping the "
in the example.