The Book Chapter 1. Yada yada yada. "); // get the children var children = node.childNodes; var length = children.length; var count = 0; while(count < length) { child = children[count]; list(child); count++; } dump(""); } else { // close tag dump("/>"); } } // if it's a piece of text just dump the text else if (type == Node.TEXT_NODE) { dump(node.data); } } list(document.documentElement); dump("\n"); ]]>