A basic demonstration of parsing an XML file looking for certain elements:
require 'rexml/document' xml = <<END_XML <people> <person> <name>P</name> <gender>Male</gender> </person> <person> <name>F</name> <gender>Male</gender> </person> </people> END_XML tree = REXML::Document.new(xml) tree.elements.each("people/person") do |person| puts person.get_elements("name").first end