I am trying to clone some XML with namespaces, but it wont work:here the code:\[code\]function cloneElement( node ){ var clone = document.createElementNS( node.namespaceURI, node.nodeName ); for( var a, i = 0; i < node.attributes.length; i++ ){ a = node.attributes[ i ]; clone.setAttributeNS( a.namespaceURI, a.nodeName, a.nodeValue ); } for( var c, nc, i = 0; i < node.childNodes.length; i++ ){ c = node.childNodes[ i ]; if( c.nodeType == 1 ){ nc = cloneElement( c ); } else { nc = document.createTextNode( c.nodeValue ); } clone.appendChild( nc ); } return clone;}\[/code\]It throws an \[code\]DOM Exception: NAMESPACE_ERR (14)\[/code\] when trying to set the attribute.What's wrong??