Recrusion Issues

I got this code:

function loadEntry ( entry : XMLNode, stage : Number ) : Entry
{
    var newEntry : Entry = new Entry ( entry, stage );
    Diagram.addEntry ( newEntry );
    trace (entry.attributes.name + " " + stage);
    for ( var i : Number = 0; i < entry.childNodes.length; i++ ) {       
        newEntry.appendChild ( loadEntry ( entry.childNodes*, stage + 1 ) );
    }
    return newEntry;
}

It goes trough an XML file and creates a tree-like structure. In every pass of the function a new instance of Entry class is created and later if there are more childs in the XMLNode, the function calls itself and adds returned intance as a child…

I know there must be a logical problem, but where? :puzzled:
Please, help. Thanks.

edit: forgot one thing… It all works well, there is only one pass of the function per entry, but in the end, it seems that all entries has all other entries as children… XML it uses is here

<layer>
    <entry name="L1E1">
        <entry name="L2E1">
            <entry name="L3E1"></entry>
            <entry name="L3E2"></entry>
        </entry>
        <entry name="L2E2"></entry>
        <entry name="L2E3">
            <entry name="L3E3"></entry>
        </entry>
    </entry>
</layer>