function (elem, elemName, func)
    {
        var i, childNode;

        for (i = 0; i < elem.childNodes.length; i++) {
            childNode = elem.childNodes[i];
            if (childNode.nodeType == Strophe.ElementType.NORMAL &&
                (!elemName || this.isTagEqual(childNode, elemName))) {
                func(childNode);
            }
        }
    }
function (elem, elemName, func)
    {
        var i, childNode;

        for (i = 0; i < elem.childNodes.length; i++) {
            childNode = elem.childNodes[i];
            if (childNode.nodeType == Strophe.ElementType.NORMAL &&
                (!elemName || this.isTagEqual(childNode, elemName))) {
                func(childNode);
            }
        }
    }
function ( elem , elemName , func ) { var i , childNode ; for ( i = 0 ; i < elem . childNodes . length ; i ++ ) { childNode = elem . childNodes [ i ] ; if ( childNode . nodeType == Strophe . ElementType . NORMAL && ( ! elemName || this . isTagEqual ( childNode , elemName ) ) ) { func ( childNode ) ; } } }
Function: forEachChild
Map a function over some or all child elements of a given element.

This is a small convenience function for mapping a function over
some or all of the children of an element.  If elemName is null, all
children will be passed to the function, otherwise only children
whose tag names match elemName will be passed.

Parameters:
(XMLElement) elem - The element to operate on.
(String) elemName - The child element tag name filter.
(Function) func - The function to apply to each child.  This
function should take a single argument, a DOM element.
Function : forEachChild Map a function over some or all child elements of a given element .
Private function to call func for each node in the tree