# frozen_string_literal: true
require "nokogiri"
require "csv"
data = File.open('continents.xml', encoding:'utf-8') { |file| Nokogiri::XML (file) }
name = data.xpath("//Name")
fcode = data.xpath("//FCode")
pool = name.zip(fcode)
CSV.open("continents.csv", "w") do |csv|
csv << ["Name", "FCode"]
pool.each do |name, fcode|
csv << [name.text, fcode.text]
end
end