Top > Ruby [2.2.2] > REXML
require 'rexml/document' doc = nil list = Array.new File.open(ARGV[0]){ |xmlfile| doc = REXML::Document.new(xmlfile) } root = doc.root root.elements.each do |child| child.each_element('*') do |child2| list << child2.to_s # xml情報を配列に記録 end end