code: function getRoute(node, options) {
  	var id = "", nodeType
  	var collapseTextNodes = options && options.collapseTextNodes;
  
  	var parent = node.parentNode;
  	var index = -1;
  
  	if(!parent) {
  		return {id:"0"};
  	}
  
  	var child = parent.firstChild;
  	var prevNodeType, siblingTag, value;
  	while(child) {
  		if(collapseTextNodes && child.nodeType === 3) {
  			siblingTag = child.nextSibling && child.nextSibling.nodeName;
  			if(prevNodeType === 3) {
  				value += child.nodeValue;
  			}
  			// TextNodes before the <head> are ignored.
  			else if(siblingTag !== "HEAD") {
  				value = child.nodeValue;
  				index++;
  			}
  		} else {
  			value = undefined;
  			index++;
  		}
  
  		if(child === node) {
  			break;
  		}
  		prevNodeType = child.nodeType;
  		child = child.nextSibling;
  	}
  
  	// ARG!
  	
  	var parentInfo;
  
  	if(parent.nodeType === 9) {
  		parentInfo = {id: ""};
  	} else {
  		parentInfo = getCachedInfo(parent);
  		if(!parentInfo || collapseTextNodes) {
  			parentInfo = getRoute(parent, options);
  		}
  	}
  
  	var parentId = parentInfo.id;
  
  	id = (parentId ? parentId + SEPARATOR : "") + index;
  
  	var routeInfo = createRouteInfo(id,
  		getBranch(index, node, parentInfo.branch),
  		collapseTextNodes ? value : undefined, collapseTextNodes);
  
  	cache(node, routeInfo);
  
  	return routeInfo;
  }
docs: Generates the route for a particular node, caching the intermediate nodes
  along the way.