# Re: xmlsimple: prevent folding multiple elements into array?

**URL:** <https://www.ruby-forum.com/t/re-xmlsimple-prevent-folding-multiple-elements-into-array/109625>\
**Category:** Ruby\
**Created:** [July 17, 2007, 12:19pm UTC](https://www.ruby-forum.com/t/re-xmlsimple-prevent-folding-multiple-elements-into-array/109625 "2007-07-17T12:19:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stickstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Post date:** [July 17, 2007, 12:19pm UTC](https://www.ruby-forum.com/t/re-xmlsimple-prevent-folding-multiple-elements-into-array/109625/1 "2007-07-17T12:19:49Z")

</div>

> I have some xml that represents a somewhat weirdly formed hash.  
> XmlSimple is eating some of my structure.

Try this:

xml = \<\<INPUT  
  
  
  
state  
  
  
open  
  
  
rate  
  
  
daily  
  
  
duration  
  
  
monthly  
  
  
  
INPUT

# See [http://www.germane-software.com/software/rexml/docs/tutorial.html](http://www.germane-software.com/software/rexml/docs/tutorial.html)

require ‘rexml/document’  
doc = REXML::Document.new(xml)  
doc.elements.each(“/kern/map/\*”) do |element|  
puts element.name, element.text.strip  
end
