From: Gordon Thiesfeld Date: 2006-03-16T06:43:46+09:00 Subject: Re: construct AoA with REXML XPath? You could use Array#zip ids = doc.elements.to_a( "//plan/id/").map{|i| i.text} => ["123", "456"] jellybeans = doc.elements.to_a( "//plan/jellyBean").map {|i| i.text} => ["RED", "BLUE"] idsAndJellyBeans = ids.zip(jellybeans) => [["123", "RED"], ["456", "BLUE"]]