 				len = chldrn.length() -1;
 				for (i= len; i >= 0;  i--)
 				{
+					removeChild(chldrn[i]);
 					// remove the nodes
 					// remove the children
 					// adjust the childIndexes
 				}
 				var curChild = _children[childIdx];
 				// Now add them in.
-				for each(chld in elements)
-				{
-					
+				len = value.length();
+				for(i=0;i<len;i++)
+				{
+					child = value[i];
 					if(!curChild)
 					{
 						curChild = appendChild(chld);

				len = chldrn.length() -1;
				for (i= len; i >= 0;  i--)
				{
					// remove the nodes
					// remove the children
					// adjust the childIndexes
				}
				var curChild = _children[childIdx];
				// Now add them in.
				for each(chld in elements)
				{
				
					if(!curChild)
					{
						curChild = appendChild(chld);

			// get rid of nodes we do not want 

			//loop through the child nodes and build XML obejcts for each.
			Object.defineProperty(this,"0",
				{
					get: function() { return this; },
					set: function(newValue:*) {
					},
					enumerable: true,
					configurable: true
				}
			);

		}
		
