Develop startElement and endElement into a general HTML pretty-printer.
Print comment nodes, text nodes, and the attributes of each element (<a href='...'>).
Use short forms like <img/> instead of <img></img> when an element has no children.
Write a test to ensure that the output can be parsed successfully.
(See Chapter 11.)