#!/usr/bin/ruby require 'xml/simple' # with next # puller = XML::Simple.pull(File.open(File.dirname($0) + "/EXAMPLE.xml")) # while puller.next do # puts puller.to_s # end # or with closure XML::Simple.pull(File.open(File.dirname($0) + "/EXAMPLE.xml")) { |puller| unless puller.attributes.empty? puller.attributes.each { |qname,value| puts "#{qname}=#{value}" } end }