<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/08/22/ignoring-comments-in-an-xml-file-in-actionscript-30/ -->
<mx:Application name="XML_ignoreComments_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white" viewSourceURL="srcview/index.html">

    <mx:Script>
        <![CDATA[
            XML.ignoreComments = false;

            private const xmlObj:XML = <TestCase>
                        <setup>
                            <!-- TODO: implement -->
                        </setup>
                        <body>
                            <!-- TODO: implement -->
                        </body>
                    </TestCase>;

            private function init():void {
                XML.ignoreComments = ignoreCommentsCheckBox.selected;
                
                var newXMLObj:XML = xmlObj.copy();
                textArea.text = newXMLObj.toXMLString();
            }
        ]]>
    </mx:Script>

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="ignoreComments:">
                <mx:CheckBox id="ignoreCommentsCheckBox"
                        change="init();" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:TextArea id="textArea"
            editable="false"
            width="100%"
            height="100%"
            creationComplete="init();" />

</mx:Application>