# File lib/nokogiri/xml/node.rb, line 695
      def write_xhtml_to io, options = {}
        if options.is_a?(String)
          $stderr.puts("Node#write_xhtml_to(io, encoding) is deprecated and will be removed in\nNokogiri version 1.4.0 *or* after June 1 2009.\nYou called write_xhtml_to from here:\n\n\#{caller.first}\n\nPlease change to Node#write_xhtml_to(io, :encoding => \#{options})\n")
          options = { :encoding => options }
        end

        # FIXME: this is a hack around broken libxml versions
        return (io << dump_html) if %w[2 6] === LIBXML_VERSION.split('.')[0..1]

        options[:save_with] ||= SaveOptions::FORMAT |
          SaveOptions::NO_DECLARATION |
          SaveOptions::NO_EMPTY_TAGS |
          SaveOptions::AS_XHTML
        write_to io, options
      end