code: 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);
          }
      }
  }
docs: Traversed XML tree with depth-first preorder search
  @param {Node} node
  @param {function} callback