diff -Naurd rexml_3.1.7.3-orig/src/rexml/formatters/pretty.rb rexml_3.1.7.3/src/rexml/formatters/pretty.rb
--- rexml_3.1.7.3-orig/src/rexml/formatters/pretty.rb	2008-01-20 09:31:17.000000000 +0200
+++ rexml_3.1.7.3/src/rexml/formatters/pretty.rb	2008-06-20 11:16:56.000000000 +0300
@@ -126,12 +126,17 @@
       end
 
       def wrap(string, width)
-        # Recursivly wrap string at width.
+        # non-recursively wrap string at width.
         return string if string.length <= width
-        place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
-        return string[0,place] + "\n" + wrap(string[place+1..-1], width)
+        acc = ''
+        begin
+          place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
+          break unless place
+          acc << string[0,place] << "\n"
+          string = string[place+1..-1]
+        end while string.length > width
+        acc << string
       end
-
     end
   end
 end
