code: def prettify(xml)
        result = ''
        formatter = REXML::Formatters::Pretty.new indent
        formatter.compact = compact
        doc = REXML::Document.new xml
        formatter.write doc, result
        result
      end
docs: Adds intendations and newlines to +xml+ to make it more readable