class Nokogiri::HTML5::Document

def to_xml(options = {}, &block)

def to_xml(options = {}, &block)
  # Bypass XML::Document#to_xml which doesn't add
  # XML::Node::SaveOptions::AS_XML like XML::Node#to_xml does.
  XML::Node.instance_method(:to_xml).bind(self).call(options, &block)
end