not a big deal  but too many levels of nested block may make people confused  what about using if break and for loops  ex if childnode i  haschildnodes break for  var iternode childnode i  firstchild iternode null  iternode iternode nextsibling if  iternode nodename  node  continue 