I'm trying to create an application that converts a file from the HTML format to the PDF format.

The approach I am using is:

1. HTML to XHTML
2. XHTML to Formatting Object
3. Formatting Object to PDF

I'm having a bit of trouble with the whole XHTML to FO(or xsl). 

Can you please tell me how to transform the XHTML to FO?

Or maybe a different approapch to the whole HTML to PDF?

Thanks, Catalin