lib/utils/xml-utils.js
function traverse(node, callback) {
    callback(node);
    for (var i = 0, cn = node.childNodes, len = cn.length; i < len; i++) {
        var childNode = cn[i];
        if (childNode.tagName) {
            traverse(childNode, callback);
        }
    }
}
function traverse(node, callback) {
    callback(node);
    for (var i = 0, cn = node.childNodes, len = cn.length; i < len; i++) {
        var childNode = cn[i];
        if (childNode.tagName) {
            traverse(childNode, callback);
        }
    }
}
function traverse ( node , callback ) { callback ( node ) ; for ( var i = 0 , cn = node . childNodes , len = cn . length ; i < len ; i ++ ) { var childNode = cn [ i ] ; if ( childNode . tagName ) { traverse ( childNode , callback ) ; } } }
Traversed XML tree with depth-first preorder search
@param {Node} node
@param {function} callback
Traversed XML tree with depth - first preorder search