# How to write variable to XML node and wrap it in CDATA

**URL:** https://forum.kirupa.com/t/how-to-write-variable-to-xml-node-and-wrap-it-in-cdata/244710
**Category:** flash
**Created:** [November 21, 2007, 2:37am UTC](https://forum.kirupa.com/t/how-to-write-variable-to-xml-node-and-wrap-it-in-cdata/244710 "2007-11-21T02:37:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![geoken](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@geoken](https://forum.kirupa.com/u/geoken)
#### Post date: [November 21, 2007, 2:37am UTC](https://forum.kirupa.com/t/how-to-write-variable-to-xml-node-and-wrap-it-in-cdata/244710/1 "2007-11-21T02:37:34Z")

</div>

Is there any way to write a variable to an XML node and wrap that variable in CDATA tags?

For example, if I have a var \_someVar, writing it into an XML node is easy; \<myNode\>{\_someVar}\</myNode\> . But what happens when I want to wrap that variable in CDATA tags? I’ve tried everything I can think of. Can someone help?
