I have to merge multiple XML-Files into one. Furthermore the structure of the new file is different. This is my "old" structure:
<a>
    <b>
        <c>1</c>
        <c></c>
        <c></c>
        <c></c>
    </b>    
    <b>
        <c>1</c>
        <c></c>
        <c></c>
        <c></c>
    </b>        
    <b>
        <c>2</c>
        <c></c>
        <c></c>
        <c></c>
    </b>    
</a>
This should be the new one:
<a>
<1>
    <b>
        <c>1</c>
        <c></c>
        <c></c>
        <c></c>
    </b>
    <b>
        <c>1</c>
        <c></c>
        <c></c>
        <c></c>
    </b>
</1>
<2>
    <b>
        <c>2</c>
        <c></c>
        <c></c>
        <c></c>
    </b>
</2>
So I need a function which can copy a b-Element and it's childs. I dont want to use for-Loops for this. Or is that the right way?