//Usage:- //copy this as file to the same folder as your FLA var s = '\r'; s += ' This is mytext node \r '; s += 'CDATASection node ]]>\r'; var x:XML = new XML(s); //by default it will enable CDATA if you dont want that to happen //uncomment the following line //XMLHighlighter.useCDATA=false; var str = XMLHighlighter.highlight(x); this.createTextField("t_txt", 0, 0, 0, Stage.width, Stage.height); t_txt.html = true; t_txt.htmlText = str;