The HtmlFormatter project is used a few (not that many) places:
https://codesearch.wmflabs.org/deployed/?q=use%20HtmlFormatter%5C%5C&i=nope
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.)