I'm generating some xml in code (as a string) and I want to set the string then as the sub elements of an existing node (using xmlNodeSetContent).
The problem is that either the xmlNodeSetContent function or the XML saving function I'm using (xmlSaveFormatFileEnc) is escaping the '<' and '>' characters as '& lt;' and '& gt;'
How do I switch the escaping off in this instance? Or, can I format the string to disable the escaping?
Possible answer: One solution I have tried is to add the relevant XML header and main element around the text string and then load the string as if it is a second XML document. I can then take the new document children and/or content and add it to my existing node. This works, but I'm hoping there is a simpler way.
Clarification: One part of my program is generating XML and only returning it as a string. I would like to take this string and inject it into an existing document. If I use xmlNodeSetContent it sort of works, except that some of of the XML syntax is escaped, which I don't want.