I have a weird requirement where I need to take some xml and re-write it so that the text nodes are wrapped in CDATA (this is for a client that won't allow normal escaping).
It doesn't seem like any of the normal XML libraries dom4j, jdom, java xml, have any built in support for this. Any ideas? Can I use XSLT for this?
I wasn't very clear. Here is what I'll start with:
<foo>This has an & escaped value</foo>
What I need to do is convert this to:
<foo><![CDATA[This has an & escaped value]]></foo>
-Dave