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

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?