require('XML::XPath') var x = %O<XML::XPath>.new(ARGF.slurp) [x.findnodes('//item[1]')][0] say [x.findnodes('//price')].map{x.getNodeText(_)} [x.findnodes('//name')]
[14.5, 23.99, 4.95, 3.56]
Last updated 1 year ago