From: Joel VanderWerf Date: 2004-04-26T04:11:26+09:00 Subject: Re: rexml: how to get element type? Mark Hubbart wrote: > something useful would be a small list of attributes, the number of > children, etc... just as long as it's no more than several lines of > text. :) I credit my irb experience with rexml as the reason I still > don't know how to use it. Something I've found useful before in writing inspect methods for hierarchical (but not XML) data is to have a depth argument to inspect, with a default of 0. The depth is passed on to sub-things, after decrementing. A depth of nil means you want to see the whole tree. Since the default is 0, using p and irb just give you the top-level stuff, whatever that means. For XML, maybe this would be, as Mark suggests, the attributes and number of children. When you want more depth, you can request it.