What this code does

It is a proof of concept—there are a couple of other ways you could do it but this is pretty succinct and functional—for taking an HTML page (must be well formed XHTML for the sample code to run on it) and apply a CSS file against it to change all the instances of “class” to inline “style.”

The main use for this I can see, and why I wrote it, is to transform the description fields of RSS/Atom feeds into style formatted XHTML.