This drills down until the `end` node has no `childNodes`. No infinite loop here as far as I can tell.