If you can afford the time to install Nokogiri, this might be a good direction to take. It has better mindshare at the moment. Anyways, could you re-run with the formatting below? (One typo found). MarkT #================================= require 'rexml/document' include REXML class Job attr_accessor :client_num, :client_name, :job_num, :job_name def generate_files() client_dir = @client_num.to_s + "_" + @client_name job_dir = @job_num.to_s + "_" + @job_name unless File.exist?(client_dir) then Dir.mkdir(client_dir) end Dir.mkdir(client_dir+"/"+job_dir) Dir.mkdir(client_dir+"/"+job_dir+"/parent") Dir.mkdir(client_dir+"/"+job_dir+"/parent/old") Dir.mkdir(client_dir+"/"+job_dir+"/parent/current") Dir.mkdir(client_dir+"/"+job_dir+"/children") Dir.mkdir(client_dir+"/"+job_dir+"/children/old") Dir.mkdir(client_dir+"/"+job_dir+"/children/current") end end def declareFiles jnumber_file = File.new("XML_EXPORT/export_j_number.xml") jname_file = File.new("XML_EXPORT/export_j_name.xml") cnumber_file = File.new("XML_EXPORT/export_cnumber.xml") cname_file = File.new("XML_EXPORT/export_c_name.xml") jnumber_file = Document.new(jnumber_file) jname_file = Document.new(jname_file) cnumber_file = Document.new(cnumber_file) cname_file = Document.new(cname_file) end j = Job.new j.client_name = cname j.client_num = cnumberfile j.job_name = cname j.job_num = jname_file j.declareFiles puts jnumber_file, jname_file, cnumber_file, cname_file j.generate_files() #=================================