﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="book" content="ActionScript&nbsp;3.0&nbsp;Language&nbsp;and&nbsp;Components&nbsp;Reference"><link rel="stylesheet" href="style.css" type="text/css" media="screen"><link rel="stylesheet" href="print.css" type="text/css" media="print"><link rel="stylesheet" href="override.css" type="text/css"><meta name="keywords" content="XML,globalClassifier.XML,-Infinity,CASEINSENSITIVE,DESCENDING,E,Infinity,LN10,LN2,LOG10E,LOG2E,MAX_VALUE,MAX_VALUE,MAX_VALUE,MIN_VALUE,MIN_VALUE,MIN_VALUE,NEGATIVE_INFINITY,NUMERIC,NaN,NaN,PI,POSITIVE_INFINITY,RETURNINDEXEDARRAY,SQRT1_2,SQRT2,UNIQUESORT,callee,constructor,date,dateUTC,day,dayUTC,dotall,errorID,extended,fixed,fullYear,fullYearUTC,global,hours,hoursUTC,ignoreCase,ignoreComments,ignoreProcessingInstructions,ignoreWhitespace,lastIndex,length,length,length,length,localName,message,milliseconds,millisecondsUTC,minutes,minutesUTC,month,monthUTC,multiline,name,prefix,prettyIndent,prettyPrinting,prototype,seconds,secondsUTC,source,time,timezoneOffset,undefined,uri,uri,Array,Boolean,Number,Object,String,UTC,Vector,XML,XMLList,abs,acos,addNamespace,appendChild,apply,asin,atan2,atan,attribute,attribute,attributes,attributes,call,ceil,charAt,charCodeAt,child,childIndex,child,children,children,comments,comments,concat,concat,concat,contains,contains,copy,copy,cos,decodeURIComponent,decodeURI,defaultSettings,descendants,descendants,elements,elements,encodeURIComponent,encodeURI,escape,every,every,exec,exp,filter,filter,floor,forEach,forEach,fromCharCode,getDate,getDay,getFullYear,getHours,getMilliseconds,getMinutes,getMonth,getSeconds,getStackTrace,getTime,getTimezoneOffset,getUTCDate,getUTCDay,getUTCFullYear,getUTCHours,getUTCMilliseconds,getUTCMinutes,getUTCMonth,getUTCSeconds,hasComplexContent,hasComplexContent,hasOwnProperty,hasOwnProperty,hasOwnProperty,hasSimpleContent,hasSimpleContent,inScopeNamespaces,indexOf,indexOf,indexOf,insertChildAfter,insertChildBefore,int,isFinite,isNaN,isPrototypeOf,isXMLName,join,join,lastIndexOf,lastIndexOf,lastIndexOf,length,length,localName,localeCompare,log,map,map,match,max,min,name,namespaceDeclarations,namespace,nodeKind,normalize,normalize,parent,parent,parse,parseFloat,parseInt,pop,pop,pow,prependChild,processingInstructions,processingInstructions,propertyIsEnumerable,propertyIsEnumerable,propertyIsEnumerable,push,push,random,removeNamespace,replace,replace,reverse,reverse,round,search,setChildren,setDate,setFullYear,setHours,setLocalName,setMilliseconds,setMinutes,setMonth,setName,setNamespace,setPropertyIsEnumerable,setSeconds,setSettings,setTime,setUTCDate,setUTCFullYear,setUTCHours,setUTCMilliseconds,setUTCMinutes,setUTCMonth,setUTCSeconds,settings,shift,shift,sin,slice,slice,slice,some,some,sortOn,sort,sort,splice,splice,split,sqrt,substr,substring,tan,test,text,text,toDateString,toExponential,toExponential,toExponential,toFixed,toFixed,toFixed,toLocaleDateString,toLocaleLowerCase,toLocaleString,toLocaleString,toLocaleString,toLocaleTimeString,toLocaleUpperCase,toLowerCase,toPrecision,toPrecision,toPrecision,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toTimeString,toUTCString,toUpperCase,toXMLString,toXMLString,trace,uint,unescape,unshift,unshift,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf"><title>XML (ActionScript 3.0)</title><script src="AC_OETags.js" type="text/javascript"></script></head><body><script language="javascript" type="text/javascript" src="asdoc.js"></script><script language="javascript" type="text/javascript" src="help.js"></script><script language="javascript" type="text/javascript" src="cookies.js"></script><script language="javascript" type="text/javascript">  
            <!--  
			    
				asdocTitle = 'XML - ActionScript 3.0 Language and Components Reference';

				var baseRef = '';

				window.onload = configPage;
			      
			    -->  
            </script>
<script language="javascript" type="text/javascript"><!--
function submitValue(){
var searchStr=document.getElementById('search-livedocs').value;
window.location="search.html"+"###"+searchStr;
}
--></script><script type="text/javascript">
		scrollToNameAnchor();
	</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">ActionScript 3.0 Language and Components Reference</td><td class="titleTableSearch" align="center"><form class="searchForm" method="get" action="search.html" onsubmit="submitValue();"><input class="hidden" name="loc" value="" type="hidden"><input class="hidden" name="termPrefix" value="" type="hidden"><input class="hidden" name="term" value="" type="hidden"><input class="hidden" name="area" value="" type="hidden"><input id="search-livedocs" name="search_text" value="" title="" type="text"> <input type="button" name="action" value="Search" onclick="submitValue()"></form></td><td class="titleTableTopNav" align="right"><a href="../../Flash/10.0_Welcome/index.html">Home</a>&nbsp;|&nbsp;<a href="package-summary.html" onclick="loadClassListFrame('all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="class-summary.html" onclick="loadClassListFrame('all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="language-elements.html">Language Elements</a>&nbsp;| <a href="all-index-Symbols.html" onclick="loadClassListFrame('index-list.html')">Index</a>&nbsp;|&nbsp;<a href="appendixes.html">Appendixes</a>&nbsp;|&nbsp;<a href="conventions.html">Conventions</a>&nbsp;|&nbsp;<a id="framesLink1" href="index.html?XML.html&amp;">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">XML</td><td class="titleTableSubNav" id="subNav" align="right" colspan="2"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a>&nbsp;| <a href="#styleSummary">Styles</a>&nbsp;| <a href="#effectSummary">Effects</a>&nbsp;| <a href="#constantSummary">Constants</a>&nbsp;| <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
                
                    
                

				<!--

				
				    
				

					if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("XML"); titleBar_setSubNav(false,true,false	,false,false,false,true,true,false	,false,false,false,false,false);}

				    
				        
				    
				-->
                
                    
                
			</script><div class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">Top Level</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public final  dynamic   class  XML</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">XML  <img src="images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="Object.html">Object</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p></p>
        The XML class contains methods and properties for working with XML objects. The XML class
 (along with the XMLList, Namespace, and QName classes) implements the 
 powerful XML-handling standards defined in ECMAScript for XML 
    (E4X) specification (ECMA-357 edition 2).
        <p>
          Use the
          <code>toXMLString()</code>
          method to return a string representation of the XML object
 regardless of whether the XML object has simple content or complex content.
        </p>
        
               <p>
                  <b>Note</b>
          : The XML class (along with related classes) from ActionScript 2.0 has been
  renamed XMLDocument and moved into the flash.xml package. 
 It is included in ActionScript 3.0 for backward compatibility.
        </p>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="Namespace.html" target="">Namespace</a><br/><a href="QName.html" target="">QName</a><br/><a href="XMLList.html" target="">XMLList</a><br/><a href="XML.html#toXMLString()" target="">XML.toXMLString()</a><br/><a href="http://www.ecma-international.org/publications/standards/Ecma-357.htm" target="mm_external">ECMAScript for XML (E4X) specification (ECMA-357 edition 2)</a></div><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><div class="showHideLinks"><div id="hideInheritedProperty" class="hideInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(false,'Property');"><img class="showHideLinkImage" src="images/expanded.gif"> Hide Inherited Public Properties</a></div><div id="showInheritedProperty" class="showInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(true,'Property');"><img class="showHideLinkImage" src="images/collapsed.gif"> Show Inherited Public Properties</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th>&nbsp;</th><th colspan="2">Property</th><th>Defined By</th></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="Object.html#constructor" class="signatureLink">constructor</a> : <a href="Object.html">Object</a><div class="summaryTableDescription">A reference to the class object or constructor function for a given object instance.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#ignoreComments" class="signatureLink">ignoreComments</a> : <a href="Boolean.html">Boolean</a><div class="summaryTableDescription">[static] Determines whether XML comments are ignored 
 when XML objects parse the source XML data.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#ignoreProcessingInstructions" class="signatureLink">ignoreProcessingInstructions</a> : <a href="Boolean.html">Boolean</a><div class="summaryTableDescription">[static] Determines whether XML 
 processing instructions are ignored when XML objects parse the source XML data.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#ignoreWhitespace" class="signatureLink">ignoreWhitespace</a> : <a href="Boolean.html">Boolean</a><div class="summaryTableDescription">[static] Determines whether white space characters
 at the beginning and end of text nodes are ignored during parsing.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#prettyIndent" class="signatureLink">prettyIndent</a> : <a href="int.html">int</a><div class="summaryTableDescription">[static] Determines the amount of indentation applied by 
 the toString() and toXMLString() methods when 
 the XML.prettyPrinting property is set to true.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#prettyPrinting" class="signatureLink">prettyPrinting</a> : <a href="Boolean.html">Boolean</a><div class="summaryTableDescription">[static] Determines whether the toString() 
 and toXMLString() methods normalize white space characters between some tags.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="Object.html#prototype" class="signatureLink">prototype</a> : <a href="Object.html">Object</a><div class="summaryTableDescription">[static] A reference to the prototype object of a class or function object.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><div class="showHideLinks"><div id="hideInheritedMethod" class="hideInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(false,'Method');"><img class="showHideLinkImage" src="images/expanded.gif"> Hide Inherited Public Methods</a></div><div id="showInheritedMethod" class="showInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(true,'Method');"><img class="showHideLinkImage" src="images/collapsed.gif"> Show Inherited Public Methods</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#XML()" class="signatureLink">XML</a>(value:<a href="Object.html">Object</a>)</div><div class="summaryTableDescription">Creates a new XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#addNamespace()" class="signatureLink">addNamespace</a>(ns:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></div><div class="summaryTableDescription">Adds a namespace to the set of in-scope namespaces for the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#appendChild()" class="signatureLink">appendChild</a>(child:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></div><div class="summaryTableDescription">Appends the given child to the end of the XML object's properties.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#attribute()" class="signatureLink">attribute</a>(attributeName:<a href="specialTypes.html#*">*</a>):<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Returns the XML value of the attribute that has the name matching the attributeName
 parameter.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#attributes()" class="signatureLink">attributes</a>():<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Returns a list of attribute values for the given XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#child()" class="signatureLink">child</a>(propertyName:<a href="Object.html">Object</a>):<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Lists the children of an XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#childIndex()" class="signatureLink">childIndex</a>():<a href="int.html">int</a></div><div class="summaryTableDescription">Identifies the zero-indexed position of this XML object within the context of its parent.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#children()" class="signatureLink">children</a>():<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Lists the children of the XML object in the sequence in which they appear.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#comments()" class="signatureLink">comments</a>():<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Lists the properties of the XML object that contain XML comments.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#contains()" class="signatureLink">contains</a>(value:<a href="XML.html">XML</a>):<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Compares the XML object against the given value parameter.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#copy()" class="signatureLink">copy</a>():<a href="XML.html">XML</a></div><div class="summaryTableDescription">Returns a copy of the given XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#defaultSettings()" class="signatureLink">defaultSettings</a>():<a href="Object.html">Object</a></div><div class="summaryTableDescription">[static] Returns an object with the following properties set to the default values: ignoreComments, 
 ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and 
 prettyPrinting.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#descendants()" class="signatureLink">descendants</a>(name:<a href="Object.html">Object</a> = *):<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the 
 XML object that have the given name parameter.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#elements()" class="signatureLink">elements</a>(name:<a href="Object.html">Object</a> = *):<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Lists the elements of an XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#hasComplexContent()" class="signatureLink">hasComplexContent</a>():<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks to see whether the XML object contains complex content.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#hasOwnProperty()" class="signatureLink">hasOwnProperty</a>(p:<a href="String.html">String</a>):<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks to see whether the object has the property specified by the p parameter.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#hasSimpleContent()" class="signatureLink">hasSimpleContent</a>():<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks to see whether the XML object contains simple content.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#inScopeNamespaces()" class="signatureLink">inScopeNamespaces</a>():<a href="Array.html">Array</a></div><div class="summaryTableDescription">Lists the namespaces for the XML object, based on the object's parent.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#insertChildAfter()" class="signatureLink">insertChildAfter</a>(child1:<a href="Object.html">Object</a>, child2:<a href="Object.html">Object</a>):<a href="specialTypes.html#*">*</a></div><div class="summaryTableDescription">Inserts the given child2 parameter after the child1 parameter in this XML object and returns the 
 resulting object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#insertChildBefore()" class="signatureLink">insertChildBefore</a>(child1:<a href="Object.html">Object</a>, child2:<a href="Object.html">Object</a>):<a href="specialTypes.html#*">*</a></div><div class="summaryTableDescription">Inserts the given child2 parameter before the child1 parameter 
 in this XML object and returns the resulting object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#isPrototypeOf()" class="signatureLink">isPrototypeOf</a>(theClass:<a href="Object.html">Object</a>):<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an instance of the Object class is in the prototype chain of the object specified 
  as the parameter.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#length()" class="signatureLink">length</a>():<a href="int.html">int</a></div><div class="summaryTableDescription">For XML objects, this method always returns the integer 1.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#localName()" class="signatureLink">localName</a>():<a href="Object.html">Object</a></div><div class="summaryTableDescription">Gives the local name portion of the qualified name of the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#name()" class="signatureLink">name</a>():<a href="Object.html">Object</a></div><div class="summaryTableDescription">Gives the qualified name for the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#namespace()" class="signatureLink">namespace</a>(prefix:<a href="String.html">String</a> = null):<a href="specialTypes.html#*">*</a></div><div class="summaryTableDescription">If no parameter is provided, gives the namespace associated with the qualified name of 
 this XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#namespaceDeclarations()" class="signatureLink">namespaceDeclarations</a>():<a href="Array.html">Array</a></div><div class="summaryTableDescription">Lists namespace declarations associated with the XML object in the context of its parent.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#nodeKind()" class="signatureLink">nodeKind</a>():<a href="String.html">String</a></div><div class="summaryTableDescription">Specifies the type of node: text, comment, processing-instruction,  
 attribute, or element.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#normalize()" class="signatureLink">normalize</a>():<a href="XML.html">XML</a></div><div class="summaryTableDescription">For the XML object and all descendant XML objects, merges adjacent text nodes and 
 eliminates empty text nodes.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#parent()" class="signatureLink">parent</a>():<a href="specialTypes.html#*">*</a></div><div class="summaryTableDescription">Returns the parent of the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#prependChild()" class="signatureLink">prependChild</a>(value:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></div><div class="summaryTableDescription">Inserts a copy of the provided child object into the XML element before any existing XML 
 properties for that element.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#processingInstructions()" class="signatureLink">processingInstructions</a>(name:<a href="String.html">String</a> = "*"):<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">If a name parameter is provided, lists all the children of the XML object 
 that contain processing instructions with that name.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#propertyIsEnumerable()" class="signatureLink">propertyIsEnumerable</a>(p:<a href="String.html">String</a>):<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks whether the property p is in the set of properties that can be iterated in a 
 for..in statement applied to the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#removeNamespace()" class="signatureLink">removeNamespace</a>(ns:<a href="Namespace.html">Namespace</a>):<a href="XML.html">XML</a></div><div class="summaryTableDescription">Removes the given namespace for this object and all descendants.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#replace()" class="signatureLink">replace</a>(propertyName:<a href="Object.html">Object</a>, value:<a href="XML.html">XML</a>):<a href="XML.html">XML</a></div><div class="summaryTableDescription">Replaces the properties specified by the propertyName parameter 
 with the given value parameter.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#setChildren()" class="signatureLink">setChildren</a>(value:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></div><div class="summaryTableDescription">Replaces the child properties of the XML object with the specified set of XML properties, 
 provided in the value parameter.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#setLocalName()" class="signatureLink">setLocalName</a>(name:<a href="String.html">String</a>):<a href="specialTypes.html#void">void</a></div><div class="summaryTableDescription">Changes the local name of the XML object to the given name parameter.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#setName()" class="signatureLink">setName</a>(name:<a href="String.html">String</a>):<a href="specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the name of the XML object to the given qualified name or attribute name.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#setNamespace()" class="signatureLink">setNamespace</a>(ns:<a href="Namespace.html">Namespace</a>):<a href="specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the namespace associated with the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#setPropertyIsEnumerable()" class="signatureLink">setPropertyIsEnumerable</a>(name:<a href="String.html">String</a>, isEnum:<a href="Boolean.html">Boolean</a> = true):<a href="specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the availability of a dynamic property for loop operations.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#setSettings()" class="signatureLink">setSettings</a>(<a href="statements.html#..._(rest)_parameter">...</a> rest):<a href="specialTypes.html#void">void</a></div><div class="summaryTableDescription">[static] Sets values for the following XML properties: ignoreComments, 
 ignoreProcessingInstructions, ignoreWhitespace,
 prettyIndent, and prettyPrinting.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#settings()" class="signatureLink">settings</a>():<a href="Object.html">Object</a></div><div class="summaryTableDescription">[static] Retrieves the following properties: ignoreComments, 
 ignoreProcessingInstructions, ignoreWhitespace, 
 prettyIndent, and prettyPrinting.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#text()" class="signatureLink">text</a>():<a href="XMLList.html">XMLList</a></div><div class="summaryTableDescription">Returns an XMLList object of all XML properties of the XML object that represent XML text nodes.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#toString()" class="signatureLink">toString</a>():<a href="String.html">String</a></div><div class="summaryTableDescription">Returns a string representation of the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#toXMLString()" class="signatureLink">toXMLString</a>():<a href="String.html">String</a></div><div class="summaryTableDescription">Returns a string representation of the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#valueOf()" class="signatureLink">valueOf</a>():<a href="XML.html">XML</a></div><div class="summaryTableDescription">Returns the XML object.</div></td><td class="summaryTableOwnerCol">XML</td></tr></table></div><script language="javascript" type="text/javascript"><!--
                      showHideInherited();
                      --></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="ignoreComments"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">ignoreComments</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>ignoreComments:<a href="Boolean.html">Boolean</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Determines whether XML comments are ignored 
 when XML objects parse the source XML data. By default, the comments are ignored 
 (
          <code>true</code>
          ). To include XML comments, set this property to
          <code>false</code>
          . 
 The
          <code>ignoreComments</code>
          property is used only during the XML parsing, not during 
 the call to any method such as
          <code>myXMLObject.child(*).toXMLString()</code>
          . 
 If the source XML includes comment nodes, they are kept or discarded during the XML parsing.
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get ignoreComments():<a href="Boolean.html">Boolean</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set ignoreComments(value:<a href="Boolean.html">Boolean</a>):<a href="specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#child()" target="">XML.child()</a><br/><a href="XML.html#toXMLString()" target="">XML.toXMLString()</a></div><br/><span class="label"> Example </span><br/><div class="detailBody">
          This example shows the effect of setting
          <code>XML.ignoreComments</code>
          to
          <code>false</code>
          and to
          <code>true</code>
          :
          <div class="listing"><pre>XML.ignoreComments = false;
var xml1:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
        &lt;/foo&gt;;
trace(xml1.toXMLString()); // &lt;foo&gt;&lt;!-- comment --&gt;&lt;/foo&gt;

XML.ignoreComments = true;
var xml2:XML = 
        &lt;foo&gt;
            &lt;!-- example --&gt;
        &lt;/foo&gt;;
trace(xml2.toXMLString()); // &lt;foo/&gt;</pre></div>
        </div></div><a name="propertyDetail"></a><a name="ignoreProcessingInstructions"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">ignoreProcessingInstructions</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>ignoreProcessingInstructions:<a href="Boolean.html">Boolean</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Determines whether XML 
 processing instructions are ignored when XML objects parse the source XML data. 
 By default, the processing instructions are ignored (
          <code>true</code>
          ). To include XML 
 processing instructions, set this property to
          <code>false</code>
          . The
          <code>ignoreProcessingInstructions</code>
          property is used only during the XML parsing, 
 not during the call to any method such as
          <code>myXMLObject.child(*).toXMLString()</code>
          .
 If the source XML includes processing instructions nodes, they are kept or discarded during 
 the XML parsing.
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get ignoreProcessingInstructions():<a href="Boolean.html">Boolean</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set ignoreProcessingInstructions(value:<a href="Boolean.html">Boolean</a>):<a href="specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#child()" target="">XML.child()</a><br/><a href="XML.html#toXMLString()" target="">XML.toXMLString()</a></div><br/><span class="label"> Example </span><br/><div class="detailBody">
          This example shows the effect of setting
          <code>XML.ignoreProcessingInstructions</code>
          to
          <code>false</code>
          and to
          <code>true</code>
          :
          <div class="listing"><pre>XML.ignoreProcessingInstructions = false;
var xml1:XML = 
        &lt;foo&gt;
            &lt;?exampleInstruction ?&gt;
        &lt;/foo&gt;;
trace(xml1.toXMLString()); // &lt;foo&gt;&lt;?exampleInstruction ?&gt;&lt;/foo&gt;

XML.ignoreProcessingInstructions = true;
var xml2:XML = 
        &lt;foo&gt;
            &lt;?exampleInstruction ?&gt;
        &lt;/foo&gt;;
trace(xml2.toXMLString()); // &lt;foo/&gt;</pre></div>
        </div></div><a name="propertyDetail"></a><a name="ignoreWhitespace"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">ignoreWhitespace</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>ignoreWhitespace:<a href="Boolean.html">Boolean</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Determines whether white space characters
 at the beginning and end of text nodes are ignored during parsing. By default, 
 white space is ignored (
          <code>true</code>
          ). If a text node is 100% white space and the
          <code>ignoreWhitespace</code>
          property is set to
          <code>true</code>
          , then the node is not created.  
 To show white space in a text node, set the
          <code>ignoreWhitespace</code>
          property to
          <code>false</code>
          .
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get ignoreWhitespace():<a href="Boolean.html">Boolean</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set ignoreWhitespace(value:<a href="Boolean.html">Boolean</a>):<a href="specialTypes.html#void">void</a></code><br/><br/><span class="label"> Example </span><br/><div class="detailBody">
          This example shows the effect of setting
          <code>XML.ignoreWhitespace</code>
          to
          <code>false</code>
          and to
          <code>true</code>
          :
          <div class="listing"><pre>XML.ignoreWhitespace = false;
var xml1:XML = &lt;foo&gt;    &lt;/foo&gt;;
trace(xml1.children().length()); // 1

XML.ignoreWhitespace = true;
var xml2:XML = &lt;foo&gt;    &lt;/foo&gt;;
trace(xml2.children().length()); // 0</pre></div>
        </div></div><a name="propertyDetail"></a><a name="prettyIndent"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">prettyIndent</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>prettyIndent:<a href="int.html">int</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Determines the amount of indentation applied by 
 the
          <code>toString()</code>
          and
          <code>toXMLString()</code>
          methods when 
 the
          <code>XML.prettyPrinting</code>
          property is set to
          <code>true</code>
          . 
 Indentation is applied with the space character, not the tab character.
 
 The default value is
          <code>2</code>
          .
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get prettyIndent():<a href="int.html">int</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set prettyIndent(value:<a href="int.html">int</a>):<a href="specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#prettyPrinting" target="">prettyPrinting</a><br/><a href="XML.html#toString()" target="">toString()</a><br/><a href="XML.html#toXMLString()" target="">toXMLString()</a></div><br/><span class="label"> Example </span><br/><div class="detailBody">
          This example shows the effect of setting the
          <code>XML.prettyIndent</code>
          static property:
          <div class="listing"><pre>var xml:XML = &lt;foo&gt;&lt;bar/&gt;&lt;/foo&gt;;
XML.prettyIndent = 0;
trace(xml.toXMLString());

XML.prettyIndent = 1;
trace(xml.toXMLString());

XML.prettyIndent = 2;
trace(xml.toXMLString());</pre></div>
        </div></div><a name="propertyDetail"></a><a name="prettyPrinting"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">prettyPrinting</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>prettyPrinting:<a href="Boolean.html">Boolean</a></code>&nbsp;&nbsp;[read-write] <p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Determines whether the
          <code>toString()</code>
          and
          <code>toXMLString()</code>
          methods normalize white space characters between some tags. 
 The default value is
          <code>true</code>
          .
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public static function get prettyPrinting():<a href="Boolean.html">Boolean</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set prettyPrinting(value:<a href="Boolean.html">Boolean</a>):<a href="specialTypes.html#void">void</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#prettyIndent" target="">prettyIndent</a><br/><a href="XML.html#toString()" target="">toString()</a><br/><a href="XML.html#toXMLString()" target="">toXMLString()</a></div><br/><span class="label"> Example </span><br/><div class="detailBody">
          This example shows the effect of setting
          <code>XML.prettyPrinting</code>
          static property:
          <div class="listing"><pre>var xml:XML = &lt;foo&gt;&lt;bar/&gt;&lt;/foo&gt;;
XML.prettyPrinting = false;
trace(xml.toXMLString());

XML.prettyPrinting = true;
trace(xml.toXMLString());</pre></div>
        </div></div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="XML()"></a><a name="XML(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">XML</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function XML(value:<a href="Object.html">Object</a>)</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p>
          Creates a new XML object. You must use the constructor to create an 
 XML object before you call any of the methods of the XML class.
          <p>
            Use the
            <code>toXMLString()</code>
            method to return a string representation of the XML object
 regardless of whether the XML object has simple content or complex content.
          </p>
          
        </p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="Object.html">Object</a></code> &mdash; 
              Any object that can be converted to XML with the top-level
              <code>XML()</code>
              function.
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="package.html#XML()" target="">top-level XML() function</a><br/><a href="XML.html#toXMLString()" target="">XML.toXMLString()</a></div></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="addNamespace()"></a><a name="addNamespace(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">addNamespace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function addNamespace(ns:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Adds a namespace to the set of in-scope namespaces for the XML object. If the namespace already 
 exists in the in-scope namespaces for the XML object (with a prefix matching that of the given 
 parameter), then the prefix of the existing namespace is set to
          <code>undefined</code>
          . If the input parameter 
 is a Namespace object, it's used directly. If it's a QName object, the input parameter's
 URI is used to create a new namespace; otherwise, it's converted to a String and a namespace is created from 
 the String.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">ns</span>:<a href="Object.html">Object</a></code> &mdash; The namespace to add to the XML object.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The new XML object, with the namespace added.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example uses a namespace defined in one XML object and applies it
 to another XML object:
          <div class="listing"><pre>var xml1:XML = &lt;ns:foo xmlns:ns="www.example.com/ns" /&gt;;
var nsNamespace:Namespace = xml1.namespace();

var xml2:XML = &lt;bar /&gt;;
xml2.addNamespace(nsNamespace);
trace(xml2.toXMLString()); // &lt;bar xmlns:ns="www.example.com/ns"/&gt;</pre></div>
        </div></div><a name="appendChild()"></a><a name="appendChild(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">appendChild</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function appendChild(child:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Appends the given child to the end of the XML object's properties.
 The
          <code>appendChild()</code>
          method takes an XML object, an XMLList object, or 
 any other data type that is then converted to a String.
          <p>
            Use the
            <code>delete</code>
            (XML) operator to remove XML nodes.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">child</span>:<a href="Object.html">Object</a></code> &mdash; The XML object to append.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The resulting XML object.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="operators.html#delete_(XML)" target="">delete (XML) operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example appends a new element to the end of the child list of an XML object:
          <div class="listing"><pre>var xml:XML = 
        &lt;body&gt;
            &lt;p&gt;hello&lt;/p&gt;
        &lt;/body&gt;;
        
xml.appendChild(&lt;p&gt;world&lt;/p&gt;);    
trace(xml.p[0].toXMLString()); // &lt;p&gt;hello&lt;/p&gt;
trace(xml.p[1].toXMLString()); // &lt;p&gt;world&lt;/p&gt;</pre></div>
        </div></div><a name="attribute()"></a><a name="attribute()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">attribute</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function attribute(attributeName:<a href="specialTypes.html#*">*</a>):<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns the XML value of the attribute that has the name matching the
          <code>attributeName</code>
          parameter. Attributes are found within XML elements. 
 In the following example, the element has an attribute named "
          <code>gender</code>
          " 
 with the value "
          <code>boy</code>
          ":
          <code>&lt;first gender="boy"&gt;John&lt;/first&gt;</code>
          .
          <p>
            The
            <code>attributeName</code>
            parameter can be any data type; however, 
 String is the most common data type to use. When passing any object other than a QName object, 
 the
            <code>attributeName</code>
            parameter uses the
            <code>toString()</code>
            method
 to convert the parameter to a string.
          </p>
          
          <p>
            If you need a qualified name reference, you can pass in a QName object. A QName object
 defines a namespace and the local name, which you can use to define the qualified name of an 
 attribute. Therefore calling
            <code>attribute(qname)</code>
            is not the same as calling
            <code>attribute(qname.toString())</code>
            .
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">attributeName</span>:<a href="specialTypes.html#*">*</a></code> &mdash; The name of the attribute.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; An XMLList object or an empty XMLList object. Returns an empty XMLList object
 when an attribute value has not been defined.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#attributes()" target="">XML.attributes()</a><br/><a href="QName.html" target="">QName</a><br/><a href="Namespace.html" target="">Namespace</a><br/><a href="XML.html#elements()" target="">XML.elements()</a><br/><a href="operators.html#attribute_identifier" target="">attribute identifier (@) operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example shows a QName object passed into the
          <code>attribute()</code>
          method. The
          <code>localName</code>
          property is
          <code>attr</code>
          and the
          <code>namespace</code>
          property
 is
          <code>ns</code>
          .
          <div class="listing"><pre>var xml:XML = &lt;ns:node xmlns:ns = "http://uri" ns:attr = '7' /&gt;       
 var qn:QName = new QName("http://uri", "attr");
 trace (xml.attribute(qn)); // 7</pre></div>
        </div><br/><div class="detailBody">
          To return an attribute with a name that matches an ActionScript reserved word, 
 use the
          <code>attribute()</code>
          method instead of the attribute identifier (@) 
 operator, as in the following example:
          <div class="listing"><pre>var xml:XML = &lt;example class="first" /&gt;
 trace(xml.attribute("class"));</pre></div>
        </div></div><a name="attributes()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">attributes</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function attributes():<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns a list of attribute values for the given XML object. Use the
          <code>name()</code>
          method with the
          <code>attributes()</code>
          method to return the name of an attribute.
 Use of
          <code>xml.attributes()</code>
          is equivalent to
          <code>xml.@*</code>
          .
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; The list of attribute values.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#attribute()" target="">XML.attribute()</a><br/><a href="XML.html#name()" target="">XML.name()</a><br/><a href="operators.html#attribute_identifier" target="">@ operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example returns the name of the attribute:
          <div class="listing"><pre>var xml:XML=&lt;example id='123' color='blue'/&gt;
trace(xml.attributes()[1].name()); //color</pre></div>
        </div><br/><div class="detailBody">
          This example returns the names of all the attributes:
          <div class="listing"><pre>var xml:XML = &lt;example id='123' color='blue'/&gt;
var attNamesList:XMLList = xml.@*;

trace (attNamesList is XMLList); // true
trace (attNamesList.length()); // 2

for (var i:int = 0; i &lt; attNamesList.length(); i++)
{ 
    trace (typeof (attNamesList[i])); // xml
    trace (attNamesList[i].nodeKind()); // attribute
    trace (attNamesList[i].name()); // id and color
}</pre></div>
        </div></div><a name="child()"></a><a name="child(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">child</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function child(propertyName:<a href="Object.html">Object</a>):<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Lists the children of an XML object. An XML child is an XML element, text node, comment, 
 or processing instruction.
          <p>
            Use the
            <code>propertyName</code>
            parameter to list the 
 contents of a specific XML child. For example, to return the contents of a child named
            <code>&lt;first&gt;</code>
            , use
            <code>child.name("first")</code>
            . You can generate the same result 
 by using the child's index number. The index number identifies the child's position in the 
 list of other XML children. For example,
            <code>name.child(0)</code>
            returns the first child 
 in a list.
          </p>
          
          <p>
            Use an asterisk (*) to output all the children in an XML document. 
 For example,
            <code>doc.child("*")</code>
            .
          </p>
          
          <p>
            Use the
            <code>length()</code>
            method with the asterisk (*) parameter of the
            <code>child()</code>
            method to output the total number of children. For example,
            <code>numChildren = doc.child("*").length()</code>
            .
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">propertyName</span>:<a href="Object.html">Object</a></code> &mdash; The element name or integer of the XML child.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; An XMLList object of child nodes that match the input parameter.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#elements()" target="">XML.elements()</a><br/><a href="XMLList.html" target="">XMLList class</a><br/><a href="XML.html#length()" target="">XML.length()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example shows the use of the
          <code>child()</code>
          method to identify child
 elements with a specified name:
          <div class="listing"><pre>var xml:XML = 
        &lt;foo&gt;
            &lt;bar&gt;text1&lt;/bar&gt;
            &lt;bar&gt;text2&lt;/bar&gt;
        &lt;/foo&gt;;
trace(xml.child("bar").length());  // 2
trace(xml.child("bar")[0].toXMLString()); // &lt;bar&gt;text1&lt;/bar&gt;
trace(xml.child("bar")[1].toXMLString()); // &lt;bar&gt;text2&lt;/bar&gt;</pre></div>
        </div></div><a name="childIndex()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">childIndex</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function childIndex():<a href="int.html">int</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Identifies the zero-indexed position of this XML object within the context of its parent.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="int.html">int</a></code> &mdash; The position of the object. Returns -1 as well as positive integers.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example shows the use of the
          <code>childIndex()</code>
          method:
          <div class="listing"><pre>var xml:XML = 
            &lt;foo&gt;
                &lt;bar /&gt;
                text
                &lt;bob /&gt;
            &lt;/foo&gt;;
trace(xml.bar.childIndex()); // 0
trace(xml.bob.childIndex()); // 2</pre></div>
        </div></div><a name="children()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">children</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function children():<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Lists the children of the XML object in the sequence in which they appear. An XML child 
 is an XML element, text node, comment, or processing instruction.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; An XMLList object of the XML object's children.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example shows the use of the
          <code>children()</code>
          method:
          <div class="listing"><pre>XML.ignoreComments = false;
XML.ignoreProcessingInstructions = false;
var xml:XML = 
        &lt;foo id="22"&gt;
            &lt;bar&gt;44&lt;/bar&gt;
            text
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
        &lt;/foo&gt;;
trace(xml.children().length()); // 4
trace(xml.children()[0].toXMLString()); // &lt;bar&gt;44&lt;/bar&gt;
trace(xml.children()[1].toXMLString()); // text
trace(xml.children()[2].toXMLString()); // &lt;!-- comment --&gt;
trace(xml.children()[3].toXMLString()); // &lt;?instruction ?&gt;</pre></div>
        </div></div><a name="comments()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">comments</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function comments():<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Lists the properties of the XML object that contain XML comments.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; An XMLList object of the properties that contain comments.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example shows the use of the
          <code>comments()</code>
          method:
          <div class="listing"><pre>XML.ignoreComments = false;
var xml:XML = 
        &lt;foo&gt;
            &lt;!-- example --&gt;
            &lt;!-- example2 --&gt;
        &lt;/foo&gt;;
trace(xml.comments().length()); // 2
trace(xml.comments()[1].toXMLString()); // &lt;!-- example2 --&gt;</pre></div>
        </div></div><a name="contains()"></a><a name="contains(XML)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">contains</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function contains(value:<a href="XML.html">XML</a>):<a href="Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Compares the XML object against the given
          <code>value</code>
          parameter.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="XML.html">XML</a></code> &mdash; A value to compare against the current XML object.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Boolean.html">Boolean</a></code> &mdash; 
              If the XML object matches the
              <code>value</code>
              parameter, then
              <code>true</code>
              ; otherwise
              <code>false</code>
              .
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example shows the use of the
          <code>contains()</code>
          method:
          <div class="listing"><pre>var xml:XML = 
        &lt;order&gt;
            &lt;item&gt;Rice&lt;/item&gt;
            &lt;item&gt;Kung Pao Shrimp&lt;/item&gt;
        &lt;/order&gt;;
trace(xml.item[0].contains(&lt;item&gt;Rice&lt;/item&gt;)); // true
trace(xml.item[1].contains(&lt;item&gt;Kung Pao Shrimp&lt;/item&gt;)); // true
trace(xml.item[1].contains(&lt;item&gt;MSG&lt;/item&gt;)); // false</pre></div>
        </div></div><a name="copy()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">copy</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function copy():<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns a copy of the given XML object. The copy is a duplicate of the entire tree of nodes. 
 The copied XML object has no parent and returns
          <code>null</code>
          if you attempt to call the
          <code>parent()</code>
          method.
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The copy of the object.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example shows that the
          <code>copy()</code>
          method creates a new instance of an XML object. 
 When you modify the copy, the original remains unchanged:
          <div class="listing"><pre>var xml1:XML = &lt;foo /&gt;;
var xml2:XML = xml1.copy();
xml2.appendChild(&lt;bar /&gt;);
trace(xml1.bar.length()); // 0
trace(xml2.bar.length()); // 1</pre></div>
        </div></div><a name="defaultSettings()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">defaultSettings</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> static function defaultSettings():<a href="Object.html">Object</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns an object with the following properties set to the default values:
          <code>ignoreComments</code>
          ,
          <code>ignoreProcessingInstructions</code>
          ,
          <code>ignoreWhitespace</code>
          ,
          <code>prettyIndent</code>
          , and
          <code>prettyPrinting</code>
          . The default values are as follows:
          <ul><li>
              <code>ignoreComments = true</code>
            </li><li>
              <code>ignoreProcessingInstructions = true</code>
            </li><li>
              <code>ignoreWhitespace = true</code>
            </li><li>
              <code>prettyIndent = 2</code>
            </li><li>
              <code>prettyPrinting = true</code>
            </li></ul>
          
          <p>
            <b>Note:</b>
            You do not apply this method to an instance of the XML class; you apply it to
            <code>XML</code>
            , as in the following code:
            <code>var df:Object = XML.defaultSettings()</code>
            .
          </p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Object.html">Object</a></code> &mdash; An object with properties set to the default settings.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#ignoreComments" target="">XML.ignoreComments</a><br/><a href="XML.html#ignoreProcessingInstructions" target="">XML.ignoreProcessingInstructions</a><br/><a href="XML.html#ignoreWhitespace" target="">XML.ignoreWhitespace</a><br/><a href="XML.html#prettyIndent" target="">XML.prettyIndent</a><br/><a href="XML.html#prettyPrinting" target="">XML.prettyPrinting</a><br/><a href="XML.html#setSettings()" target="">XML.setSettings()</a><br/><a href="XML.html#settings()" target="">XML.settings()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows: how to apply some custom settings (for including comments and processing
 instructions) prior to setting an XML object; how to then revert back to the default settings before setting another XML
 object; and then how to set the custom settings again (for setting any more XML objects):
          <div class="listing"><pre>XML.ignoreComments = false;
XML.ignoreProcessingInstructions = false;
var customSettings:Object = XML.settings();

var xml1:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
        &lt;/foo&gt;;
trace(xml1.toXMLString());
//    &lt;foo&gt;
//        &lt;!-- comment --&gt;
//         &lt;?instruction ?&gt;
//    &lt;/foo&gt;

XML.setSettings(XML.defaultSettings());
var xml2:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
        &lt;/foo&gt;;
trace(xml2.toXMLString());</pre></div>
        </div></div><a name="descendants()"></a><a name="descendants(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">descendants</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function descendants(name:<a href="Object.html">Object</a> = *):<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the 
 XML object that have the given
          <code>name</code>
          parameter. The
          <code>name</code>
          parameter
 is optional. The
          <code>name</code>
          parameter can be a QName object, a String data type
 or any other data type that is then converted to a String data type.
          <p>To return all descendants, use the "*" parameter. If no parameter is passed,
 the string "*" is passed and returns all descendants of the XML object.</p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">name</span>:<a href="Object.html">Object</a></code> (default = <code>*</code>)<code></code> &mdash; The name of the element to match.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; An XMLList object of matching descendants. If there are no descendants, returns an 
 empty XMLList object.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="operators.html#descendant_accessor" target="">descendant accessor (..) operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          To return descendants with names that match ActionScript reserved words, use the
          <code>descendants()</code>
          method instead of the descendant (..) operator, as in the 
 following example:
          <div class="listing"><pre>var xml:XML = 
  &lt;enrollees&gt;
    &lt;student id="239"&gt;
        &lt;class name="Algebra" /&gt;
        &lt;class name="Spanish 2"/&gt;
    &lt;/student&gt;
    &lt;student id="206"&gt;
        &lt;class name="Trigonometry" /&gt;
        &lt;class name="Spanish 2" /&gt;
    &lt;/student&gt;
  &lt;/enrollees&gt;
trace(xml.descendants("class"));</pre></div>
        </div><br/><div class="detailBody">
          The following example shows that the
          <code>descendants()</code>
          method returns an XMLList object
 that contains
          <i>all</i>
          descendant objects, including children, grandchildren, and so on:
          <div class="listing"><pre>XML.ignoreComments = false;
var xml:XML = 
        &lt;body&gt;
            &lt;!-- comment --&gt;
            text1
            &lt;a&gt;
                &lt;b&gt;text2&lt;/b&gt;
            &lt;/a&gt;
        &lt;/body&gt;;
trace(xml.descendants("*").length()); // 5
trace(xml.descendants("*")[0]); // // &lt;!-- comment --&gt;
trace(xml.descendants("*")[1].toXMLString()); // text1
trace(xml.descendants("a").toXMLString()); // &lt;a&gt;&lt;b&gt;text2&lt;/b&gt;&lt;/a&gt;
trace(xml.descendants("b").toXMLString()); // &lt;b&gt;text2&lt;/b&gt;</pre></div>
        </div></div><a name="elements()"></a><a name="elements(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">elements</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function elements(name:<a href="Object.html">Object</a> = *):<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Lists the elements of an XML object. An element consists of a start and an end tag; 
  for example
          <code>&lt;first&gt;&lt;/first&gt;</code>
          . The
          <code>name</code>
          parameter 
  is optional. The
          <code>name</code>
          parameter can be a QName object, a String data type,
  or any other data type that is then converted to a String data type. Use the
          <code>name</code>
          parameter to list a specific element. For example, 
  the element "
          <code>first</code>
          " returns "
          <code>John</code>
          " in this example:
          <code>&lt;first&gt;John&lt;/first&gt;</code>
          .
          <p>To list all elements, use the asterisk (*) as the 
  parameter. The asterisk is also the default parameter.</p>
          
          <p>
            Use the
            <code>length()</code>
            method with the asterisk parameter to output the total 
  number of elements. For example,
            <code>numElement = addressbook.elements("*").length()</code>
            .
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">name</span>:<a href="Object.html">Object</a></code> (default = <code>*</code>)<code></code> &mdash; 
              The name of the element. An element's name is surrounded by angle brackets. 
  For example, "
              <code>first</code>
              " is the
              <code>name</code>
              in this example:
              <code>&lt;first&gt;&lt;/first&gt;</code>
              .
            </td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; An XMLList object of the element's content. The element's content falls between the start and 
  end tags. If you use the asterisk (*) to call all elements, both the 
  element's tags and content are returned.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#child()" target="">XML.child()</a><br/><a href="XMLList.html" target="">XMLList class</a><br/><a href="XML.html#length()" target="">XML.length()</a><br/><a href="XML.html#attribute()" target="">XML.attribute()</a><br/><a href="operators.html#dot_(XML)" target="">XML dot (.) operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows that the
          <code>elements()</code>
          method returns a 
 list of elements only
 &mdash; not comments, text properties, or processing instructions:
          <div class="listing"><pre>var xml:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
            text
            &lt;a&gt;1&lt;/a&gt;
            &lt;b&gt;2&lt;/b&gt;
        &lt;/foo&gt;;
trace(xml.elements("*").length()); // 2
trace(xml.elements("*")[0].toXMLString()); // &lt;a&gt;1&lt;/a&gt;
trace(xml.elements("b").length()); // 1
trace(xml.elements("b")[0].toXMLString()); // &lt;b&gt;2&lt;/b&gt;</pre></div>
        </div><br/><div class="detailBody">
          To return elements with names that match ActionScript reserved words, 
 use the
          <code>elements()</code>
          method instead of the XML dot (.) operator, 
 as in the following example:
          <div class="listing"><pre>var xml:XML =
 &lt;student id="206"&gt;
    &lt;class name="Trigonometry" /&gt;
    &lt;class name="Spanish 2" /&gt;
 &lt;/student&gt;
trace(xml.elements("class"));</pre></div>
        </div></div><a name="hasComplexContent()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">hasComplexContent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function hasComplexContent():<a href="Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Checks to see whether the XML object contains complex content. An XML object contains complex content if  
 it has child elements. XML objects that representing attributes, comments, processing instructions, 
 and text nodes do not have complex content. However, an object that
          <i>contains</i>
          these can 
 still be considered to contain complex content (if the object has child elements).
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Boolean.html">Boolean</a></code> &mdash; 
              If the XML object contains complex content,
              <code>true</code>
              ; otherwise
              <code>false</code>
              .
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#hasSimpleContent()" target="">XML.hasSimpleContent()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows an XML object with one property named
          <code>a</code>
          that has
 simple content and one property named
          <code>a</code>
          that has complex content:
          <div class="listing"><pre>var xml:XML = 
        &lt;foo&gt;
            &lt;a&gt;
                text
            &lt;/a&gt;
            &lt;a&gt;
                &lt;b/&gt;
            &lt;/a&gt;
        &lt;/foo&gt;;
trace(xml.a[0].hasComplexContent()); // false
trace(xml.a[1].hasComplexContent()); // true

trace(xml.a[0].hasSimpleContent()); // true
trace(xml.a[1].hasSimpleContent()); // false</pre></div>
        </div></div><a name="hasOwnProperty()"></a><a name="hasOwnProperty(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">hasOwnProperty</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function hasOwnProperty(p:<a href="String.html">String</a>):<a href="Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Checks to see whether the object has the property specified by the
          <code>p</code>
          parameter.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">p</span>:<a href="String.html">String</a></code> &mdash; The property to match.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Boolean.html">Boolean</a></code> &mdash; 
              If the property exists,
              <code>true</code>
              ; otherwise
              <code>false</code>
              .
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>hasOwnProperty()</code>
          method to ensure
 that a property (
          <code>b</code>
          ) exists prior to evaluating an expression (
          <code>b == "11"</code>
          ) that uses the
 property:
          <div class="listing"><pre>var xml:XML = 
        &lt;foo&gt;
            &lt;a /&gt;
            &lt;a&gt;
                &lt;b&gt;10&lt;/b&gt;
            &lt;/a&gt;
            &lt;a&gt;
                &lt;b&gt;11&lt;/b&gt;
            &lt;/a&gt;
        &lt;/foo&gt;;
trace(xml.a.(hasOwnProperty("b") && b == "11"));</pre></div>
          If the last line in this example were the following, Flash Player would throw an exception since 
 the first element named
          <code>a</code>
          does not have a property named
          <code>b</code>
          :
          <p>
            
            <pre>trace(xml.a.(b == "11"));</pre>
            
          </p>
          
        </div><br/><div class="detailBody">
          The following example uses the
          <code>hasOwnProperty()</code>
          method to ensure
 that a property (
          <code>item</code>
          ) exists prior to evaluating an expression 
 (
          <code>item.contains("toothbrush")</code>
          ) that uses the
 property:
          <div class="listing"><pre>var xml:XML = 
        &lt;orders&gt;
            &lt;order id='1'&gt;
                &lt;item&gt;toothbrush&lt;/item&gt;
                &lt;item&gt;toothpaste&lt;/item&gt;
            &lt;/order&gt;
            &lt;order&gt;
                &lt;returnItem&gt;shoe polish&lt;/returnItem&gt;
            &lt;/order&gt;
        &lt;/orders&gt;;
trace(xml.order.(hasOwnProperty("item") && item.contains("toothbrush")));</pre></div>
        </div></div><a name="hasSimpleContent()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">hasSimpleContent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function hasSimpleContent():<a href="Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Checks to see whether the XML object contains simple content. An XML object contains simple content 
 if it represents a text node, an attribute node, or an XML element that has no child elements. 
 XML objects that represent comments and processing instructions do
          <i>not</i>
          contain simple 
 content.
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Boolean.html">Boolean</a></code> &mdash; 
              If the XML object contains simple content,
              <code>true</code>
              ; otherwise
              <code>false</code>
              .
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#hasComplexContent()" target="">XML.hasComplexContent()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows an XML object with one property named
          <code>a</code>
          that has
 simple content and one property named
          <code>a</code>
          that has complex content:
          <div class="listing"><pre>var xml:XML = 
        &lt;foo&gt;
            &lt;a&gt;
                text
            &lt;/a&gt;
            &lt;a&gt;
                &lt;b/&gt;
            &lt;/a&gt;
        &lt;/foo&gt;;
trace(xml.a[0].hasComplexContent()); // false
trace(xml.a[1].hasComplexContent()); // true

trace(xml.a[0].hasSimpleContent()); // true
trace(xml.a[1].hasSimpleContent()); // false</pre></div>
        </div></div><a name="inScopeNamespaces()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">inScopeNamespaces</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function inScopeNamespaces():<a href="Array.html">Array</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Lists the namespaces for the XML object, based on the object's parent.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Array.html">Array</a></code> &mdash; An array of Namespace objects.</td></tr></table></div><a name="insertChildAfter()"></a><a name="insertChildAfter(Object,Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">insertChildAfter</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function insertChildAfter(child1:<a href="Object.html">Object</a>, child2:<a href="Object.html">Object</a>):<a href="specialTypes.html#*">*</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Inserts the given
          <code>child2</code>
          parameter after the
          <code>child1</code>
          parameter in this XML object and returns the 
 resulting object. If the
          <code>child1</code>
          parameter is
          <code>null</code>
          , the method
 inserts the contents of
          <code>child2</code>
          
          <i>before</i>
          all children of the XML object 
 (in other words, after
          <i>none</i>
          ). If
          <code>child1</code>
          is provided, but it does not 
 exist in the XML object, the XML object is not modified and
          <code>undefined</code>
          is 
 returned.
          <p>
            If you call this method on an XML child that is not an element (text, attributes, comments, pi, and so on)
            <code>undefined</code>
            is returned.
          </p>
          
          <p>
            Use the
            <code>delete</code>
            (XML) operator to remove XML nodes.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">child1</span>:<a href="Object.html">Object</a></code> &mdash; 
              The object in the source object that you insert before
              <code>child2</code>
              .
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">child2</span>:<a href="Object.html">Object</a></code> &mdash; The object to insert.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="specialTypes.html#*">*</a></code> &mdash; 
              The resulting XML object or
              <code>undefined</code>
              .
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#insertChildBefore()" target="">XML.insertChildBefore()</a><br/><a href="operators.html#delete_(XML)" target="">delete (XML) operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example appends an element to the end of the child elements of an XML object:
          <div class="listing"><pre>var xml:XML = 
        &lt;menu&gt;
            &lt;item&gt;burger&lt;/item&gt;
            &lt;item&gt;soda&lt;/item&gt;
        &lt;/menu&gt;;
xml.insertChildAfter(xml.item[0], &lt;saleItem&gt;fries&lt;/saleItem&gt;);
trace(xml);</pre></div>
          The
          <code>trace()</code>
          output is the following:
          <pre>
            <code>&lt;menu&gt;
 	&lt;item&gt;burger&lt;/item&gt;
 	&lt;saleItem&gt;fries&lt;/saleItem&gt;
 	&lt;item&gt;soda&lt;/item&gt;
 &lt;/menu&gt;</code>
          </pre>
          
        </div></div><a name="insertChildBefore()"></a><a name="insertChildBefore(Object,Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">insertChildBefore</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function insertChildBefore(child1:<a href="Object.html">Object</a>, child2:<a href="Object.html">Object</a>):<a href="specialTypes.html#*">*</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Inserts the given
          <code>child2</code>
          parameter before the
          <code>child1</code>
          parameter 
 in this XML object and returns the resulting object. If the
          <code>child1</code>
          parameter 
 is
          <code>null</code>
          , the method inserts the contents of
          <code>child2</code>
          
          <i>after</i>
          all children of the XML object (in other words, before
          <i>none</i>
          ). If
          <code>child1</code>
          is provided, but it does not exist in the XML object, 
 the XML object is not modified and
          <code>undefined</code>
          is returned.
          <p>
            If you call this method on an XML child that is not an element (text, attributes, 
 comments, pi, and so on)
            <code>undefined</code>
            is returned.
          </p>
          
          <p>
            Use the
            <code>delete</code>
            (XML) operator to remove XML nodes.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">child1</span>:<a href="Object.html">Object</a></code> &mdash; 
              The object in the source object that you insert after
              <code>child2</code>
              .
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">child2</span>:<a href="Object.html">Object</a></code> &mdash; The object to insert.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="specialTypes.html#*">*</a></code> &mdash; 
              The resulting XML object or
              <code>undefined</code>
              .
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#insertChildAfter()" target="">XML.insertChildAfter()</a><br/><a href="operators.html#delete_(XML)" target="">delete (XML) operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example appends an element to the end of the child elements of an XML object:
          <div class="listing"><pre>var xml:XML = 
        &lt;menu&gt;
            &lt;item&gt;burger&lt;/item&gt;
            &lt;item&gt;soda&lt;/item&gt;
        &lt;/menu&gt;;
xml.insertChildBefore(xml.bar[0], &lt;saleItem&gt;fries&lt;/saleItem&gt;);
trace(xml);</pre></div>
          The
          <code>trace()</code>
          output is the following:
          <pre>
            <code>&lt;menu&gt;
 	&lt;saleItem&gt;fries&lt;/saleItem&gt;
 	&lt;item&gt;burger&lt;/item&gt;
 	&lt;item&gt;soda&lt;/item&gt;
 &lt;/menu&gt;</code>
          </pre>
          
        </div></div><a name="length()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">length</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function length():<a href="int.html">int</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          For XML objects, this method always returns the integer
          <code>1</code>
          . 
 The
          <code>length()</code>
          method of the XMLList class returns a value of
          <code>1</code>
          for 
 an XMLList object that contains only one value.
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="int.html">int</a></code> &mdash; 
              Always returns
              <code>1</code>
              for any XML object.
            </td></tr></table></div><a name="localName()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">localName</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function localName():<a href="Object.html">Object</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Gives the local name portion of the qualified name of the XML object.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Object.html">Object</a></code> &mdash; 
              The local name as either a String or
              <code>null</code>
              .
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example illustrates the use of the
          <code>localName()</code>
          method:
          <div class="listing"><pre>var xml:XML = 
        &lt;soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
            soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"&gt;

                        &lt;soap:Body xmlns:wx = "http://example.com/weather"&gt;
                &lt;wx:forecast&gt;
                    &lt;wx:city&gt;Quito&lt;/wx:city&gt;
                &lt;/wx:forecast&gt;
            &lt;/soap:Body&gt;
        &lt;/soap:Envelope&gt;;
        
trace(xml.localName()); // Envelope</pre></div>
        </div></div><a name="name()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">name</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function name():<a href="Object.html">Object</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Gives the qualified name for the XML object.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Object.html">Object</a></code> &mdash; 
              The qualified name is either a QName or
              <code>null</code>
              .
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#attributes()" target="">XML.attributes()</a><br/><a href="operators.html#attribute_identifier" target="">attribute identifier</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example illustrates the use of the
          <code>name()</code>
          method to get the qualified
 name of an XML object:
          <div class="listing"><pre>var xml:XML = 
        &lt;soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
            soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"&gt;

                        &lt;soap:Body xmlns:wx = "http://example.com/weather"&gt;
                &lt;wx:forecast&gt;
                    &lt;wx:city&gt;Quito&lt;/wx:city&gt;
                &lt;/wx:forecast&gt;
            &lt;/soap:Body&gt;
        &lt;/soap:Envelope&gt;;
        
trace(xml.name().localName); // Envelope
trace(xml.name().uri); // "http://www.w3.org/2001/12/soap-envelope"</pre></div>
        </div><br/><div class="detailBody">
          The following example illustrates the use of the
          <code>name()</code>
          method called on an XML property,
 on a text element, and on an attribute:
          <div class="listing"><pre>var xml:XML = 
        &lt;foo x="15" y="22"&gt;
            text
        &lt;/foo&gt;;
        
trace(xml.name().localName); // foo
trace(xml.name().uri == ""); // true
trace(xml.children()[0]); // text
trace(xml.children()[0].name()); // null
trace(xml.attributes()[0]); // 15
trace(xml.attributes()[0].name()); // x</pre></div>
        </div></div><a name="namespace()"></a><a name="namespace(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">namespace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function namespace(prefix:<a href="String.html">String</a> = null):<a href="specialTypes.html#*">*</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          If no parameter is provided, gives the namespace associated with the qualified name of 
 this XML object. If a
          <code>prefix</code>
          parameter is specified, the method returns the namespace 
 that matches the
          <code>prefix</code>
          parameter and that is in scope for the XML object. If there is no 
 such namespace, the method returns
          <code>undefined</code>
          .
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">prefix</span>:<a href="String.html">String</a></code> (default = <code>null</code>)<code></code> &mdash; The prefix you want to match.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="specialTypes.html#*">*</a></code> &mdash; 
              Returns
              <code>null</code>
              ,
              <code>undefined</code>
              , or a namespace.
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>namespace()</code>
          method 
 to get the namespace of an XML object and assign it to a Namespace object named
          <code>soap</code>
          which is then used in identifying a property of the
          <code>xml</code>
          object 
 (
          <code>xml.soap::Body[0]</code>
          ):
          <div class="listing"><pre>var xml:XML = 
        &lt;soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
            soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"&gt;

                        &lt;soap:Body xmlns:wx = "http://example.com/weather"&gt;
                &lt;wx:forecast&gt;
                    &lt;wx:city&gt;Quito&lt;/wx:city&gt;
                &lt;/wx:forecast&gt;
            &lt;/soap:Body&gt;
        &lt;/soap:Envelope&gt;;
        
var soap:Namespace = xml.namespace();
trace(soap.prefix); // soap
trace(soap.uri); // http://www.w3.org/2001/12/soap-envelope

var body:XML = xml.soap::Body[0];
trace(body.namespace().prefix); // soap
trace(xml.namespace().uri); // http://www.w3.org/2001/12/soap-envelope
trace(body.namespace("wx").uri); // "http://example.com/weather"</pre></div>
        </div><br/><div class="detailBody">
          The following example uses the
          <code>namespace()</code>
          method to get the 
 default namespace for a node, as well as the namespace for a specific prefix (
          <code>"dc"</code>
          ):
          <div class="listing"><pre>var xml:XML = 
        &lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
            xmlns:dc="http://purl.org/dc/elements/1.1/" 
            xmlns="http://purl.org/rss/1.0/"&gt;
                &lt;!-- ... --&gt;
        &lt;/rdf:RDF&gt;;
                    
trace(xml.namespace()); // http://www.w3.org/1999/02/22-rdf-syntax-ns#
trace(xml.namespace("dc")); // http://purl.org/dc/elements/1.1/
trace(xml.namespace("foo")); // undefined</pre></div>
        </div></div><a name="namespaceDeclarations()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">namespaceDeclarations</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function namespaceDeclarations():<a href="Array.html">Array</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Lists namespace declarations associated with the XML object in the context of its parent.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Array.html">Array</a></code> &mdash; An array of Namespace objects.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#namespace()" target="">XML.namespace()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example outputs the namespace declarations of an
 XML object:
          <div class="listing"><pre>var xml:XML = 
        &lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
            xmlns:dc="http://purl.org/dc/elements/1.1/" 
            xmlns="http://purl.org/rss/1.0/"&gt;

            &lt;!-- ... --&gt;
            
        &lt;/rdf:RDF&gt;;
                    
for (var i:uint = 0; i &lt; xml.namespaceDeclarations().length; i++) {
    var ns:Namespace = xml.namespaceDeclarations()[i]; 
    var prefix:String = ns.prefix;
    if (prefix == "") {
        prefix = "(default)";
    }
    trace(prefix + ":" , ns.uri);
}</pre></div>
          The
          <code>trace()</code>
          output is the following:
          <pre>
            <code>rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
 dc: http://purl.org/dc/elements/1.1/
 (default): http://purl.org/rss/1.0/</code>
          </pre>
        </div></div><a name="nodeKind()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">nodeKind</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function nodeKind():<a href="String.html">String</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Specifies the type of node: text, comment, processing-instruction,  
 attribute, or element.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="String.html">String</a></code> &mdash; The node type used.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="operators.html#attribute_identifier" target="">attribute identifier</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          This example traces all five node types:
          <div class="listing"><pre>XML.ignoreComments = false;
XML.ignoreProcessingInstructions = false;

var xml:XML = 
    &lt;example id="10"&gt;
        &lt;!-- this is a comment --&gt;
        &lt;?test this is a pi ?&gt;
        and some text
    &lt;/example&gt;;

trace(xml.nodeKind()); // element
trace(xml.children()[0].nodeKind()); // comment
trace(xml.children()[1].nodeKind()); // processing-instruction
trace(xml.children()[2].nodeKind()); // text
trace(xml.@id[0].nodeKind()); // attribute</pre></div>
        </div></div><a name="normalize()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">normalize</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function normalize():<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>For the XML object and all descendant XML objects, merges adjacent text nodes and 
 eliminates empty text nodes.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The resulting normalized XML object.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows the effect of calling the
          <code>normalize()</code>
          method:
          <div class="listing"><pre>var xml:XML = &lt;body&gt;&lt;/body&gt;;
xml.appendChild("hello");
xml.appendChild(" world");
trace(xml.children().length()); // 2
xml.normalize();
trace(xml.children().length()); // 1</pre></div>
        </div></div><a name="parent()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">parent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function parent():<a href="specialTypes.html#*">*</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns the parent of the XML object. If the XML object has no parent, the method returns
          <code>undefined</code>
          .
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="specialTypes.html#*">*</a></code> &mdash; 
              The parent XML object. Returns either a
              <code>String</code>
              or
              <code>null</code>
              .
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>parent()</code>
          method to identify the parent element
 of a specific element in an XML structure:
          <div class="listing"><pre>var xml:XML = 
    &lt;body&gt;
        &lt;p id="p1"&gt;Hello&lt;/p&gt;
        &lt;p id="p2"&gt;Test:
            &lt;ul&gt;
                &lt;li&gt;1&lt;/li&gt;
                &lt;li&gt;2&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/p&gt;
    &lt;/body&gt;;
var node:XML = xml.p.ul.(li.contains("1"))[0]; // == &lt;ul&gt; ... &lt;/ul&gt;
trace(node.parent().@id); // p2</pre></div>
        </div></div><a name="prependChild()"></a><a name="prependChild(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">prependChild</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function prependChild(value:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Inserts a copy of the provided
          <code>child</code>
          object into the XML element before any existing XML 
 properties for that element.
          <p>
            Use the
            <code>delete</code>
            (XML) operator to remove XML nodes.
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="Object.html">Object</a></code> &mdash; The object to insert.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The resulting XML object.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="operators.html#delete_(XML)" target="">delete (XML) operator</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>prependChild()</code>
          method to add an element to the 
 begining of a child list of an XML object:
          <div class="listing"><pre>var xml:XML = 
        &lt;body&gt;
            &lt;p&gt;hello&lt;/p&gt;
        &lt;/body&gt;;
        
xml.prependChild(&lt;p&gt;world&lt;/p&gt;);    
trace(xml.p[0].toXMLString()); // &lt;p&gt;world&lt;/p&gt;
trace(xml.p[1].toXMLString()); // &lt;p&gt;hello&lt;/p&gt;</pre></div>
        </div></div><a name="processingInstructions()"></a><a name="processingInstructions(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">processingInstructions</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function processingInstructions(name:<a href="String.html">String</a> = "*"):<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          If a
          <code>name</code>
          parameter is provided, lists all the children of the XML object 
 that contain processing instructions with that
          <code>name</code>
          . With no parameters, the method 
 lists all the children of the XML object that contain any processing instructions.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">name</span>:<a href="String.html">String</a></code> (default = "<code>*</code>")<code></code> &mdash; The name of the processing instructions to match.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; A list of matching child objects.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>processingInstructions()</code>
          method to get an
 array of processing instructions for an XML object:
          <div class="listing"><pre>XML.ignoreProcessingInstructions = false;
var xml:XML =
    &lt;body&gt;
            foo
            &lt;?xml-stylesheet href="headlines.css" type="text/css" ?&gt;
            &lt;?instructionX ?&gt;
            
    &lt;/body&gt;;

trace(xml.processingInstructions().length()); // 2
trace(xml.processingInstructions()[0].name()); // xml-stylesheet</pre></div>
        </div></div><a name="propertyIsEnumerable()"></a><a name="propertyIsEnumerable(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">propertyIsEnumerable</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function propertyIsEnumerable(p:<a href="String.html">String</a>):<a href="Boolean.html">Boolean</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Checks whether the property
          <code>p</code>
          is in the set of properties that can be iterated in a
          <code>for..in</code>
          statement applied to the XML object. Returns
          <code>true</code>
          only 
 if
          <code>toString(p) == "0"</code>
          .
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">p</span>:<a href="String.html">String</a></code> &mdash; The property that you want to check.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Boolean.html">Boolean</a></code> &mdash; 
              If the property can be iterated in a
              <code>for..in</code>
              statement,
              <code>true</code>
              ; 
 otherwise,
              <code>false</code>
              .
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows that, for an XML object, the
          <code>propertyNameIsEnumerable()</code>
          method returns a value of
          <code>true</code>
          only for the value
          <code>0</code>
          ; whereas for an 
 XMLList object, the return value is
          <code>true</code>
          for each valid index 
 value for the XMLList object:
          <div class="listing"><pre>var xml:XML = 
        &lt;body&gt;
             &lt;p&gt;Hello&lt;/p&gt;
               &lt;p&gt;World&lt;/p&gt;
        &lt;/body&gt;;

trace(xml.propertyIsEnumerable(0)); // true
trace(xml.propertyIsEnumerable(1)); // false

for (var propertyName:String in xml) {
    trace(xml[propertyName]);
}

var list:XMLList = xml.p;
trace(list.propertyIsEnumerable(0)); // true
trace(list.propertyIsEnumerable(1)); // true
trace(list.propertyIsEnumerable(2)); // false

for (var propertyName:String in list) { 
    trace(list[propertyName]);
}</pre></div>
        </div></div><a name="removeNamespace()"></a><a name="removeNamespace(Namespace)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">removeNamespace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function removeNamespace(ns:<a href="Namespace.html">Namespace</a>):<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Removes the given namespace for this object and all descendants. The
          <code>removeNamespaces()</code>
          method does not remove a namespace if it is referenced by the object's qualified name or the 
 qualified name of the object's attributes.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">ns</span>:<a href="Namespace.html">Namespace</a></code> &mdash; The namespace to remove.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; A copy of the resulting XML object.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows how to remove a namespace declaration
 from an XML object:
          <div class="listing"><pre>var xml:XML = 
    &lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
        xmlns:dc="http://purl.org/dc/elements/1.1/" 
        xmlns="http://purl.org/rss/1.0/"&gt;
    
        &lt;!-- ... --&gt;
        
    &lt;/rdf:RDF&gt;;

trace(xml.namespaceDeclarations().length); // 3
trace(xml.namespaceDeclarations()[0] is String); // 
var dc:Namespace = xml.namespace("dc");
xml.removeNamespace(dc);
trace(xml.namespaceDeclarations().length); // 2</pre></div>
        </div></div><a name="replace()"></a><a name="replace(Object,XML)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">replace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function replace(propertyName:<a href="Object.html">Object</a>, value:<a href="XML.html">XML</a>):<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Replaces the properties specified by the
          <code>propertyName</code>
          parameter 
 with the given
          <code>value</code>
          parameter. 
 If no properties match
          <code>propertyName</code>
          , the XML object is left unmodified.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">propertyName</span>:<a href="Object.html">Object</a></code> &mdash; Can be a 
 numeric value, an unqualified name for a set of XML elements, a qualified name for a set of 
 XML elements, or the asterisk wildcard ("*"). 
 Use an unqualified name to identify XML elements in the default namespace.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="XML.html">XML</a></code> &mdash; 
              The replacement value. This can be an XML object, an XMLList object, or any value 
 that can be converted with
              <code>toString()</code>
              .
            </td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The resulting XML object, with the matching properties replaced.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example illustrates calling the
          <code>replace()</code>
          method
 with an integer as the first parameter:
          <div class="listing"><pre>var xml:XML = 
    &lt;body&gt;
        &lt;p&gt;Hello&lt;/p&gt;
        &lt;p&gt;World&lt;/p&gt;
        &lt;hr/&gt;
    &lt;/body&gt;;

xml.replace(1, &lt;p&gt;Bob&lt;/p&gt;);
trace(xml);</pre></div>
          This results in the following
          <code>trace()</code>
          output:
          <pre>
            <code>&lt;body&gt;
 	&lt;p&gt;Hello&lt;/p&gt;
 	&lt;p&gt;Bob&lt;/p&gt;
 	&lt;hr/&gt;
 &lt;/body&gt;</code>
          </pre>
        </div><br/><div class="detailBody">
          The following example calls
          <code>replace()</code>
          method
 with a string as the first parameter:
          <div class="listing"><pre>var xml:XML = 
    &lt;body&gt;
        &lt;p&gt;Hello&lt;/p&gt;
        &lt;p&gt;World&lt;/p&gt;
        &lt;hr/&gt;
    &lt;/body&gt;;

xml.replace("p", &lt;p&gt;Hi&lt;/p&gt;); 
trace(xml);</pre></div>
          This results in the following
          <code>trace()</code>
          output:
          <pre>
            <code>&lt;body&gt;
 	&lt;p&gt;Hi&lt;/p&gt;
 	&lt;hr/&gt;
 &lt;/body&gt;;</code>
          </pre>
        </div><br/><div class="detailBody">
          The following example illustrates calling the
          <code>replace()</code>
          method
 with a QName as the first parameter:
          <div class="listing"><pre>var xml:XML = 
    &lt;ns:body xmlns:ns = "myNS"&gt;
        &lt;ns:p&gt;Hello&lt;/ns:p&gt;
        &lt;ns:p&gt;World&lt;/ns:p&gt;
        &lt;hr/&gt;
    &lt;/ns:body&gt;;

var qname:QName = new QName("myNS", "p");
xml.replace(qname, &lt;p&gt;Bob&lt;/p&gt;);
trace(xml);</pre></div>
          This results in the following
          <code>trace()</code>
          output:
          <pre>
            <code>&lt;ns:body xmlns:ns = "myNS"&gt;
 	&lt;p&gt;Bob&lt;/p&gt;
 	&lt;hr/&gt;
 &lt;/ns:body&gt;</code>
          </pre>
        </div><br/><div class="detailBody">
          The following example illustrates calling the
          <code>replace()</code>
          method
 with the string
          <code>"*"</code>
          as the first parameter:
          <div class="listing"><pre>var xml:XML = 
    &lt;body&gt;
        &lt;p&gt;Hello&lt;/p&gt;
        &lt;p&gt;World&lt;/p&gt;
        &lt;hr/&gt;
    &lt;/body&gt;;

xml.replace("*", &lt;img src = "hello.jpg"/&gt;);
trace(xml);</pre></div>
          This results in the following
          <code>trace()</code>
          output:
          <pre>
            <code>&lt;body&gt;
 	&lt;img src="hello.jpg"/&gt;
 &lt;/body&gt;</code>
          </pre>
        </div></div><a name="setChildren()"></a><a name="setChildren(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">setChildren</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function setChildren(value:<a href="Object.html">Object</a>):<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Replaces the child properties of the XML object with the specified set of XML properties, 
 provided in the
          <code>value</code>
          parameter.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">value</span>:<a href="Object.html">Object</a></code> &mdash; The replacement XML properties. Can be a single XML object or an XMLList object.</td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The resulting XML object.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example illustrates calling the
          <code>setChildren()</code>
          method, first
 using an XML object as the parameter, and then using an XMLList object as the parameter:
          <div class="listing"><pre>var xml:XML = 
    &lt;body&gt;
        &lt;p&gt;Hello&lt;/p&gt;
        &lt;p&gt;World&lt;/p&gt;
    &lt;/body&gt;;

var list:XMLList = xml.p;

xml.setChildren(&lt;p&gt;hello&lt;/p&gt;);
trace(xml);

//    &lt;body&gt;
//        &lt;p&gt;hello&lt;/p&gt;
//    &lt;/body&gt;

xml.setChildren(list);
trace(xml);

//    &lt;body&gt;
//        &lt;p&gt;Hello&lt;/p&gt;
//        &lt;p&gt;World&lt;/p&gt;
//    &lt;/body&gt;</pre></div>
        </div></div><a name="setLocalName()"></a><a name="setLocalName(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">setLocalName</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function setLocalName(name:<a href="String.html">String</a>):<a href="specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Changes the local name of the XML object to the given
          <code>name</code>
          parameter.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">name</span>:<a href="String.html">String</a></code> &mdash; The replacement name for the local name.</td></tr></table></p><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>setLocalName()</code>
          method
 to change the local name of an XML element:
          <div class="listing"><pre>var xml:XML = 
    &lt;ns:item xmlns:ns="http://example.com"&gt;
        toothbrush
    &lt;/ns:item&gt;;
    
xml.setLocalName("orderItem");
trace(xml.toXMLString()); // &lt;ns:orderItem xmlns:ns="http://example.com"&gt;toothbrush&lt;/ns:orderItem&gt;</pre></div>
        </div></div><a name="setName()"></a><a name="setName(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">setName</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function setName(name:<a href="String.html">String</a>):<a href="specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Sets the name of the XML object to the given qualified name or attribute name.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">name</span>:<a href="String.html">String</a></code> &mdash; The new name for the object.</td></tr></table></p><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>setName()</code>
          method
 to change the name of an XML element:
          <div class="listing"><pre>var xml:XML = 
    &lt;item&gt;
        toothbrush
    &lt;/item&gt;;
    
xml.setName("orderItem");
trace(xml.toXMLString()); // &lt;orderItem&gt;toothbrush&lt;/orderItem&gt;</pre></div>
        </div></div><a name="setNamespace()"></a><a name="setNamespace(Namespace)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">setNamespace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function setNamespace(ns:<a href="Namespace.html">Namespace</a>):<a href="specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Sets the namespace associated with the XML object.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">ns</span>:<a href="Namespace.html">Namespace</a></code> &mdash; The new namespace.</td></tr></table></p><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>soap</code>
          namespace defined in one XML object 
 and applies it to the namespace of another XML object (
          <code>xml2</code>
          ):
          <div class="listing"><pre>var xml1:XML = 
        &lt;soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
            soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"&gt;
            &lt;!-- ... --&gt;
        &lt;/soap:Envelope&gt;;
var ns:Namespace = xml1.namespace("soap");

var xml2:XML = 
    &lt;Envelope&gt;
        &lt;Body/&gt;
    &lt;/Envelope&gt;;
    
xml2.setNamespace(ns);

trace(xml2);</pre></div>
        </div></div><a name="setSettings()"></a><a name="setSettings(restParam)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">setSettings</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> static function setSettings(<a href="statements.html#..._(rest)_parameter">...</a> rest):<a href="specialTypes.html#void">void</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Sets values for the following XML properties:
          <code>ignoreComments</code>
          ,
          <code>ignoreProcessingInstructions</code>
          ,
          <code>ignoreWhitespace</code>
          ,
          <code>prettyIndent</code>
          , and
          <code>prettyPrinting</code>
          .
 
 The following are the default settings, which are applied if no
          <code>setObj</code>
          parameter
 is provided:
          <ul><li>
              <code>XML.ignoreComments = true</code>
            </li><li>
              <code>XML.ignoreProcessingInstructions = true</code>
            </li><li>
              <code>XML.ignoreWhitespace = true</code>
            </li><li>
              <code>XML.prettyIndent = 2</code>
            </li><li>
              <code>XML.prettyPrinting = true</code>
            </li></ul>
          
          <p>
            <b>Note</b>
            : You do not apply this method to an instance of the XML class; you apply it to
            <code>XML</code>
            , as in the following code:
            <code>XML.setSettings()</code>
            .
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><a href="statements.html#..._(rest)_parameter">...</a> <span class="label">rest</span></code> &mdash; 
              An object with each of the following properties:
              <ul><li>
                  <code>ignoreComments</code>
                </li><li>
                  <code>ignoreProcessingInstructions</code>
                </li><li>
                  <code>ignoreWhitespace</code>
                </li><li>
                  <code>prettyIndent</code>
                </li><li>
                  <code>prettyPrinting</code>
                </li></ul>
              
            </td></tr></table></p><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#ignoreComments" target="">ignoreComments</a><br/><a href="XML.html#ignoreProcessingInstructions" target="">ignoreProcessingInstructions</a><br/><a href="XML.html#ignoreWhitespace" target="">ignoreWhitespace</a><br/><a href="XML.html#prettyIndent" target="">prettyIndent</a><br/><a href="XML.html#prettyPrinting" target="">prettyPrinting</a><br/><a href="XML.html#defaultSettings()" target="">defaultSettings()</a><br/><a href="XML.html#settings()" target="">settings()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows: how to apply some custom settings (for including comments and processing
 instructions) prior to setting an XML object; how to then revert back to the default settings before setting another XML
 object; and then how to set the custom settings again (for setting any more XML objects):
          <div class="listing"><pre>XML.ignoreComments = false;
XML.ignoreProcessingInstructions = false;
var customSettings:Object = XML.settings();

var xml1:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
        &lt;/foo&gt;;
trace(xml1.toXMLString());
//    &lt;foo&gt;
//        &lt;!-- comment --&gt;
//         &lt;?instruction ?&gt;
//    &lt;/foo&gt;

XML.setSettings(XML.defaultSettings());
var xml2:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
        &lt;/foo&gt;;
trace(xml2.toXMLString());</pre></div>
        </div></div><a name="settings()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">settings</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> static function settings():<a href="Object.html">Object</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Retrieves the following properties:
          <code>ignoreComments</code>
          ,
          <code>ignoreProcessingInstructions</code>
          ,
          <code>ignoreWhitespace</code>
          ,
          <code>prettyIndent</code>
          , and
          <code>prettyPrinting</code>
          .
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="Object.html">Object</a></code> &mdash; 
              An object with the following XML properties:
              <ul><li>
                  <code>ignoreComments</code>
                </li><li>
                  <code>ignoreProcessingInstructions</code>
                </li><li>
                  <code>ignoreWhitespace</code>
                </li><li>
                  <code>prettyIndent</code>
                </li><li>
                  <code>prettyPrinting</code>
                </li></ul>
              
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#ignoreComments" target="">XML.ignoreComments</a><br/><a href="XML.html#ignoreProcessingInstructions" target="">XML.ignoreProcessingInstructions</a><br/><a href="XML.html#ignoreWhitespace" target="">XML.ignoreWhitespace</a><br/><a href="XML.html#prettyIndent" target="">XML.prettyIndent</a><br/><a href="XML.html#prettyPrinting" target="">XML.prettyPrinting</a><br/><a href="XML.html#defaultSettings()" target="">XML.defaultSettings()</a><br/><a href="XML.html#setSettings()" target="">XML.setSettings()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows: how to apply some custom settings (for including comments and processing
 instructions) prior to setting an XML object; how to then revert back to the default settings before setting another XML
 object; and then how to set the custom settings again (for setting any more XML objects):
          <div class="listing"><pre>XML.ignoreComments = false;
XML.ignoreProcessingInstructions = false;
var customSettings:Object = XML.settings();

var xml1:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
        &lt;/foo&gt;;
trace(xml1.toXMLString());
//    &lt;foo&gt;
//        &lt;!-- comment --&gt;
//         &lt;?instruction ?&gt;
//    &lt;/foo&gt;

XML.setSettings(XML.defaultSettings());
var xml2:XML = 
        &lt;foo&gt;
            &lt;!-- comment --&gt;
            &lt;?instruction ?&gt;
        &lt;/foo&gt;;
trace(xml2.toXMLString());</pre></div>
        </div></div><a name="text()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">text</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function text():<a href="XMLList.html">XMLList</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Returns an XMLList object of all XML properties of the XML object that represent XML text nodes.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XMLList.html">XMLList</a></code> &mdash; The list of properties.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example uses the
          <code>text()</code>
          method to get the text nodes of 
 an XML object:
          <div class="listing"><pre>var xml:XML =
        &lt;body&gt;
            text1
            &lt;hr/&gt;
            text2
        &lt;/body&gt;;
trace(xml.text()[0]); // text1
trace(xml.text()[1]); // text2</pre></div>
        </div></div><a name="toString()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">toString</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function toString():<a href="String.html">String</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns a string representation of the XML object. The rules for this conversion depend on whether  
 the XML object has simple content or complex content:
          <ul><li>
              If the XML object has simple content,
              <code>toString()</code>
              returns the String contents of the 
 XML object with  the following stripped out: the start tag, attributes, namespace declarations, and 
 end tag.
            </li></ul>
          
          <ul><li>
              If the XML object has complex content,
              <code>toString()</code>
              returns an XML encoded String 
 representing the entire XML object, including the start tag, attributes, namespace declarations, 
 and end tag.
            </li></ul>
          
          <p>
            To return the entire XML object every time, use
            <code>toXMLString()</code>
            .
          </p>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="String.html">String</a></code> &mdash; The string representation of the XML object.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#hasSimpleContent()" target="">XML.hasSimpleContent()</a><br/><a href="XML.html#hasComplexContent()" target="">XML.hasComplexContent()</a><br/><a href="XML.html#toXMLString()" target="">XML.toXMLString()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows what the
          <code>toString()</code>
          method returns when the 
 XML object has simple content:
          <div class="listing"><pre>var test:XML = &lt;type name="Joe"&gt;example&lt;/type&gt;;
trace(test.toString()); //example</pre></div>
        </div><br/><div class="detailBody">
          The following example shows what the
          <code>toString()</code>
          method returns when the 
 XML object has complex content:
          <div class="listing"><pre>var test:XML = 
&lt;type name="Joe"&gt;
    &lt;base name="Bob"&gt;&lt;/base&gt;
    example
&lt;/type&gt;;
trace(test.toString());
  // &lt;type name="Joe"&gt;
  // &lt;base name="Bob"/&gt;
  // example
  // &lt;/type&gt;</pre></div>
        </div></div><a name="toXMLString()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">toXMLString</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function toXMLString():<a href="String.html">String</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>
          Returns a string representation of the XML object. Unlike the
          <code>toString()</code>
          method,
 the
          <code>toXMLString()</code>
          method always returns the start tag, attributes,
 and end tag of the XML object, regardless of whether the XML object has simple content or complex 
 content. (The
          <code>toString()</code>
          method strips out these items for XML objects that contain 
 simple content.)
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="String.html">String</a></code> &mdash; The string representation of the XML object.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="XML.html#toString()" target="">XML.toString()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows the difference between using the
          <code>toString()</code>
          method 
 (which is applied to all parameters of a
          <code>trace()</code>
          method, by default) and using the
          <code>toXMLString()</code>
          method:
          <div class="listing"><pre>var xml:XML =
        &lt;p&gt;hello&lt;/p&gt;;
trace(xml); // hello
trace(xml.toXMLString()); // &lt;p&gt;hello&lt;/p&gt;</pre></div>
        </div></div><a name="valueOf()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">valueOf</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function valueOf():<a href="XML.html">XML</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 9</td></tr></table><p></p><p></p><p>Returns the XML object.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="XML.html">XML</a></code> &mdash; The primitive value of an XML instance.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows that the value returned by the
          <code>valueOf()</code>
          method
 is the same as the source XML object:
          <div class="listing"><pre>var xml:XML = &lt;p&gt;hello&lt;/p&gt;;
trace(xml.valueOf() === xml); // true</pre></div>
        </div></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples<span class="usage"><a href="ExampleInstruct.html"> How to use examples </a></span></div><div class="exampleHeader">XMLExample.as</div><br/><div class="detailBody">
        The following example first creates an XML variable and adds nodes to it. 
 Then XML properties are used to find and print XML nodes.  Notice that the "at" 
 (
        <code>@</code>
        ) symbol is used in several of the
        <code>trace()</code>
        calls to locate information
 by attribute name.
        <div class="listing"><pre>package {
    import flash.display.Sprite;

    public class XmlExample extends Sprite {        
        public function XmlExample() {
            var employees:XML =
                &lt;employees&gt;
                    &lt;employee ssn="123-123-1234"&gt;
                        &lt;name first="John" last="Doe"/&gt;
                        &lt;address&gt;
                            &lt;street&gt;11 Main St.&lt;/street&gt;
                            &lt;city&gt;San Francisco&lt;/city&gt;
                            &lt;state&gt;CA&lt;/state&gt;
                            &lt;zip&gt;98765&lt;/zip&gt;
                        &lt;/address&gt;
                    &lt;/employee&gt;
                    &lt;employee ssn="789-789-7890"&gt;
                        &lt;name first="Mary" last="Roe"/&gt;
                        &lt;address&gt;
                            &lt;street&gt;99 Broad St.&lt;/street&gt;
                            &lt;city&gt;Newton&lt;/city&gt;
                            &lt;state&gt;MA&lt;/state&gt;
                            &lt;zip&gt;01234&lt;/zip&gt;
                        &lt;/address&gt;
                    &lt;/employee&gt;
                &lt;/employees&gt;;

            trace(employees.employee[0].address.zip);   // 98765

            trace(employees.employee[1].@ssn);          // 789-789-7890

            trace(employees.employee.name);             // &lt;name first="John" last="Doe"/&gt;
                                                        // &lt;name first="Mary" last="Roe"/&gt;

            trace(employees..zip[0]);                   // 98765

            trace(employees..@ssn[1]);                  // 789-789-7890

            trace(employees..name);                     // &lt;name first="John" last="Doe"/&gt;
                                                        // &lt;name first="Mary" last="Roe"/&gt;

            trace(employees.employee[0].address.*);     // &lt;street&gt;11 Main St.&lt;/street&gt;    
                                                        // &lt;city&gt;San Francisco&lt;/city&gt;
                                                        // &lt;state&gt;CA&lt;/state&gt;
                                                        // &lt;zip&gt;98765&lt;/zip&gt;
            var node:String = "zip";
            trace(employees.employee[0].address[node]); // 98765
            
            var attribute:String = "ssn";
            trace(employees.employee[1].@[attribute]);  // 789-789-7890
            
            for each (var num:XML in employees..@ssn) {
                trace(num);                             // 123-123-1234
            }                                           // 789-789-7890
            
            var ssnToFind:String = "789-789-7890";
            trace(employees.employee.(@ssn == ssnToFind).toXMLString());
                                                        // &lt;employee ssn="789-789-7890"&gt;
                                                        // &lt;name first="Mary" last="Roe"/&gt;
                                                        // &lt;address&gt;
                                                        // &lt;street&gt;99 Broad St.&lt;/street&gt;
                                                        // &lt;city&gt;Newton&lt;/city&gt;
                                                        // &lt;state&gt;MA&lt;/state&gt;
                                                        // &lt;zip&gt;01234&lt;/zip&gt;
                                                        // &lt;/address&gt;
                                                        // &lt;/employee&gt;
        }
    }
}</pre></div>
      </div><br/><br/><hr><br/><p></p><center class="copyright"> &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  </center><div style="display:none">XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML XML </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
