Interesting Behavior When Swapping Live Nodes In A ColdFusion XML Document

<!--- Create a ColdFusion XML document. --->
<cfxml variable="xmlData">
 
	<toes>
		<toe id="1" isticklish="yes" />
		<toe id="2" isticklish="yes" />
		<toe id="3" isticklish="no" />
		<toe id="4" isticklish="no" />
		<toe id="5" isticklish="yes" />
	</toes>
 
</cfxml>
 
 
<!--- Store the 3rd node in a temp variable. --->
<cfset xmlTemp = xmlData.toes.toe[ 3 ] />
 
<!--- Set the 3rd node to point to the 2nd node. --->
<cfset xmlData.toes.toe[ 3 ] = xmlData.toes.toe[ 2 ] />
 
<!---
	Now, store the old 3rd node pointer back into the
	2nd node. This should effectively swap nodes 2 and 3.
--->
<cfset xmlData.toes.toe[ 2 ] = xmlTemp />
 
<!--- Dump out new ColdFusion XML structure. --->
<cfdump
	var="#xmlData#"
	label="xmlData After Swap."
	/>

For Cut-and-Paste