I'm struggling to find a good example of how one would add an XML Element to an XML Document and also add the data (inner-text) to this same element, but wrap the data in CDATA tags?
Here is an example of what I need. I have the following document.
<data>
<config>
<documentation>This is my documentation<documentation>
</config>
</data>
I then want to add a element and CDATA as the inner-text. So it would look something like this. The data that I need to wrap in CDATA tags can be fairly large and will need to be read/referenced from file.
<data>
<config>
<documentation>This is my documentation<documentation>
<script><![CDATA[
function foo()
…
End
]]>
</script>
</config>
</data>
I then need to write the changes out to a new document... (so that I have the original and the additions.