Just draw or print the Dom tree using a js version of graphviz tools. This is for teaching purpose. This does not scales (because graphviz does not allows large graph/tree)