function iterateChildren( node, parentId ) {
                var newNode = self.createNode( node, parentId, tree, null );

                if ( node.children ) {
                    // pseudo node is used for descending children to the next level
                    if ( node.childrenDropLevel && node.childrenDropLevel > 0 ) {
                        while ( node.childrenDropLevel-- ) {
                            // pseudo node needs to inherit the connection style from its parent for continuous connectors
                            var connStyle = UTIL.cloneObj( newNode.connStyle );
                            newNode = self.createNode( 'pseudo', newNode.id, tree, null );
                            newNode.connStyle = connStyle;
                            newNode.children = [];
                        }
                    }

                    var stack = ( node.stackChildren && !self.hasGrandChildren( node ) )? newNode.id: null;

                    // children are positioned on separate levels, one beneath the other
                    if ( stack !== null ) {
                        newNode.stackChildren = [];
                    }

                    for ( var i = 0, len = node.children.length; i < len ; i++ ) {
                        if ( stack !== null ) {
                            newNode =  self.createNode( node.children[i], newNode.id, tree, stack );
                            if ( ( i + 1 ) < len ) {
                                // last node cant have children
                                newNode.children = [];
                            }
                        }
                        else {
                            iterateChildren( node.children[i], newNode.id );
                        }
                    }
                }
            }
@param {object} node
@param {number} parentId