in JSDOMParser.js [611:623]
function getElem(node) {
var length = node.children.length;
if (node.id === id) {
return node;
}
for (var i = 0; i < length; i++) {
var el = getElem(node.children[i]);
if (el) {
return el;
}
}
return null;
}