class Nokogiri::XML::Node

def to_s

returns html. If the document is XML, this method returns XML.
Turn this node in to a string. If the document is HTML, this method
##
def to_s
  document.xml? ? to_xml : to_html
end