The HtmlFormatter project is used a few (not that many) places:
It is built on libxml and xpath with a bunch of hacks to avoid bugs, and a partial CSS-selector-to-xpath translator. We should rebase this on Remex (to parse HTML) and zest.php (to match selectors). This will allow us to reduce our dependence on libxml, increase code coverage and usage of Remex, improve corner case parsing of HTML and selectors, and generally put our eggs in fewer baskets.
(It's possible we shouldn't use zest, but should instead just use a slightly better version of CSS-selector-to-xpath, which can be shared with Parsoid.)