Cleans up extracted HTML to produce formatted XHTML