store xml inside xml
You can use CDATA:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><root><data> <![CDATA[ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <otherxml>data</otherxml> ]]></data>
Note when you get the value for data
, it will be as a string so you'd have to run it through a new XML parser.
Here is an example code for omniXML:
var xml:IXMLDocument; Node:IXMLNode;begin xml := CreateXMLDoc; xml.SelectSingleNode('/root/data',Node); ShowMessage(GetNodeCData(Node,'data',''));end;
if the content in data doesn't have to be read rigth away you can encode it in for example Base64 or UUEncode.
Then you can extract, decode and parse the data