# File rexml/formatters/pretty.rb, line 105defwrite_document( node, output )
# Ok, this is a bit odd. All XML documents have an XML declaration,# but it may not write itself if the user didn't specifically add it,# either through the API or in the input document. If it doesn't write# itself, then we don't need a carriage return... which makes this# logic more complex.node.children.each { |child|nextifchild==node.children[-1] andchild.instance_of?(Text)
unlesschild==node.children[0] orchild.instance_of?(Text) or
(child==node.children[1] and!node.children[0].writethis)
output<<"\n"endwrite( child, output )
}
end