Index: lib/rexml/document.rb =================================================================== --- lib/rexml/document.rb (revision 18748) +++ lib/rexml/document.rb (working copy) @@ -185,6 +185,7 @@ end formatter = if indent > -1 if transitive + require "rexml/formatters/transitive" REXML::Formatters::Transitive.new( indent, ie_hack ) else REXML::Formatters::Pretty.new( indent, ie_hack ) Index: lib/rexml/element.rb =================================================================== --- lib/rexml/element.rb (revision 19271) +++ lib/rexml/element.rb (working copy) @@ -691,6 +691,7 @@ Kernel.warn("#{self.class.name}.write is deprecated. See REXML::Formatters") formatter = if indent > -1 if transitive + require "rexml/formatters/transitive" REXML::Formatters::Transitive.new( indent, ie_hack ) else REXML::Formatters::Pretty.new( indent, ie_hack ) Index: lib/rexml/formatters/transitive.rb =================================================================== --- lib/rexml/formatters/transitive.rb (revision 19271) +++ lib/rexml/formatters/transitive.rb (working copy) @@ -12,9 +12,10 @@ # formatted. Since this formatter does not alter whitespace nodes, the # results of formatting already formatted XML will be odd. class Transitive < Default - def initialize( indentation=2 ) + def initialize( indentation=2, ie_hack=false ) @indentation = indentation @level = 0 + @ie_hack = ie_hack end protected @@ -29,6 +30,7 @@ output << "\n" output << ' '*@level if node.children.empty? + output << " " if @ie_hack output << "/" else output << ">"