class Nokogiri::XML::Node

def to_html encoding = nil

Serialize this Node to HTML using +encoding+
##
def to_html encoding = nil
  # FIXME: this is a hack around broken libxml versions
  return dump_html if %w[2 6] === LIBXML_VERSION.split('.')[0..1]
  serialize(encoding, SaveOptions::FORMAT |
                      SaveOptions::NO_DECLARATION |
                      SaveOptions::NO_EMPTY_TAGS |
                      SaveOptions::AS_HTML)
end