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"]]