class Nokogiri::XML::Node

def to_xhtml options = {}

See Node#write_to for a list of +options+

doc.to_xhtml(:indent => 5, :encoding => 'UTF-8')

Serialize this Node to XHTML using +options+
##
def to_xhtml options = {}
  # FIXME: this is a hack around broken libxml versions
  return dump_html if Nokogiri.uses_libxml? && %w[2 6] === LIBXML_VERSION.split('.')[0..1]
  options[:save_with] |= SaveOptions::DEFAULT_XHTML if options[:save_with]
  options[:save_with] = SaveOptions::DEFAULT_XHTML unless options[:save_with]
  serialize(options)
end