Programmatically create HTML (XHTML, 4.x, 5) for PHP 5.3+