Need to copy one XML Node to another node with a different node name

Posted on 2011-10-07
Last Modified: 2012-05-12
I have an XML file similar to the one shown below.  What I need to do but don't know how is to make a copy of the node list1 with all of its attributes and subnodes and call it list2.  Is there an easy way to do this?

I'm using VB6.
       more node stuff here
       more node stuff here
    <list1 Default="(none)" ID="660" Customize="Y">
       <Choice value="(none)" Description="(none)" />
       <Choice value="Cirrus/Maestro" Description="Company MasterCard" />
       <Choice value="MasterCard" Description="Personal MasterCard" />

Open in new window

Question by:dyarosh
    LVL 44

    Expert Comment

    by:Martin Liss
    Take a look here.

    Author Comment

    I looked at that already and the problem is it makes a copy of the same node.  I need to make a copy of the node attributes and all of its child nodes but give it a different node name.
    LVL 44

    Accepted Solution


    Author Closing Comment


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now