I have two XML objects floating around and I want to take data from the first one and put it in the second one. I am getting an error when I try to append the child from the first document to the second one.

The error I am getting is on the AppendChild line, and I am getting:

ERROR#: -2147024809, description: 'The parameter is incorrect.'


VB Code:
  1. 'objXML is a valid XML DOMDocument with a few child nodes in it.
  2.  
  3. Dim objNewXML As DOMDocument
  4. Dim objNewNode as IXMLDomNode
  5. Dim objNode as IXMLDomNode
  6.  
  7. Set objNewNode = objNewXML.createElement("Toolbar")
  8. For Each objNode In objXML.childNodes(0).childNodes
  9. objNewNode.appendChild objNode.cloneNode(True)
  10. Next
  11. objNewXML.appendChild objNewNode
  12.  
  13. MsgBox objNewXML.xml

I remember something that you can't directly copy the nodes from one doc to another, but I thought using clone would get around that. Any assistance would be appreciated.

Thanks,