Hi, I need a bit of help preventing empty namespaces littering my xml output. The goal of the routine is to concatenate seperate xml-files (or rather parts of) into one. With CloneNode, copying node from the input xml-file to an output is easy. But empty xmlns-tags are added. These I need to avoid. I'm extremely new at xml, so be gentle on the following sample code. best regards glenn -----Input----- <VATSENDING xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <VATRECORD> <RECNUM>001</RECNUM> <VATNUMBER>123456002</VATNUMBER> </VATRECORD> </VATSENDING> --------------- -----Output---- <VATSENDING xmlns="http://www.w3.org/2001/XMLSchema-instance"> <VATRECORD xmlns=""> <<<<---- xmlns="" these offend <RECNUM>001</RECNUM> <VATNUMBER>123456002</VATNUMBER> </VATRECORD> <VATRECORD xmlns=""> <<<<---- xmlns="" these offend <RECNUM>002</RECNUM> <VATNUMBER>123456002</VATNUMBER> </VATRECORD> <VATRECORD xmlns=""> <<<<---- xmlns="" these offend <RECNUM>003</RECNUM> <VATNUMBER>123456002</VATNUMBER> </VATRECORD> </VATSENDING> --------------- ----- Sub testxml() Dim o_XML_In As MSXML2.DOMDocument Dim o_XML_Out As MSXML2.DOMDocument Dim o_root As MSXML2.IXMLDOMElement Dim o_XML_Elt As MSXML2.IXMLDOMElement Dim o_XML_copy As MSXML2.IXMLDOMElement Dim n_CNTID As Long Set o_XML_In = New MSXML2.DOMDocument With o_XML_In .async = False .validateOnParse = False .Load "in.xml" End With 'Element to duplicate Set o_XML_Elt = o_XML_In.documentElement.selectSingleNode ("VATRECORD") 'output file Set o_XML_Out = New MSXML2.DOMDocument With o_XML_Out .async = False .validateOnParse = False End With 'Create root element in output file Set o_root = o_XML_Out.createNode(1, "VATSENDING", "http://www.w3.org/2001/XMLSchema-instance") o_XML_Out.appendChild o_root Set o_root = o_XML_Out.documentElement 'as test, duplicate node a few times, but modify counter n_CNTID = 1 While n_CNTID < 4 Set o_XML_copy = o_XML_Elt.cloneNode(True) o_XML_copy.childNodes.Item(0).nodeTypedValue = Format (n_CNTID, "000") o_root.appendChild o_XML_copy n_CNTID = n_CNTID + 1 Wend o_XML_Out.Save "out.xml" End Sub