If you know what HTML you want to generate, then it should be easy to write the XSLT code to produce it. If you don't know what HTML you want to generate, then you have an HTML problem and not an XSLT problem.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference