I got it using a different way to generate the hash structure -

xml.elements.each("/kp:process/kp:activity"){ |e|
@activityName[e.attributes["name"]] = 
xml.elements(e.elements["child::pd:inputBindings"])
}

-- 
Posted via http://www.ruby-forum.com/.