[PHP] Dynamicly tidy HTML to XHTML (without php tidy ext.)

Ok so I thought this would be dead easy quick google, but I cant seem to find anything.

Basicly I want to convert a string (document) of HTML into valid XHTML including styles rather than <font> etc. Thing is I want to do it dynamicly with PHP, I have seen the tidy extention for php, but it’s not really practical for my application (I want it to be easy to install - independant of extentions) .

I am using http://tinymce.moxiecode.com/ which in itself seems a tidy editor but doen’t produce valid XHTML. I just wanted a php class to do this for me and I dont have time to write my own!

Anyone know of anything ?

Thanks much.