phpHtmllib is a set of PHP classes and library functions to help facilitate building, debugging, and rendering of XML, HTML, XHTML, WAP/WML Documents, and SVG (Scalable Vector Graphics) images as well as complex html ‘widgets’. It provides a mechanism to output perfectly indented/readable tags, and a programmatic API to generating tags on the fly. More information can be found on the phpHtmlLib plugin page.