def write_to io, *options
if options.length > 0 && !options.first.is_a?(Hash)
$stderr.puts("Node#write_to(io, encoding, save_options) is deprecated and will be removed in\nNokogiri version 1.4.0 *or* after June 1 2009.\nYou called write_to from here:\n\n\#{caller.first}\n\nPlease change to: Node#write_to(io, :encoding => e, :save_options => opts)\n")
end
options = options.first.is_a?(Hash) ? options.shift : {}
encoding = options[:encoding] || options[0]
save_options = options[:save_with] || options[1] || SaveOptions::FORMAT
indent_text = options[:indent_text] || ' '
indent_times = options[:indent] || 2
config = SaveOptions.new(save_options)
yield config if block_given?
native_write_to(io, encoding, indent_text * indent_times, config.options)
end