From: Mark Thomas Date: 2008-09-27T04:54:34+09:00 Subject: Re: Merge XML documents with Ruby On Sep 26, 2:04 pm, Harm wrote: > Dear group, > > Currently I'm working with Ruby to merge several XML documents into > one. I'm using Builder to construct the 'master' XML file: > >     x = Builder::XmlMarkup.new(:indent => 2) >     x.instruct! :xml, :version => "1.0", :encoding => "UTF-8" >     result = x.header do |xml| >       some_hash.each do |key, values| >         xml.company(key) >         values.each do |value| >           xml.department(value.to_xml) >         end >       end >     end > > However on the spot where I write 'xml.department' trouble strikes. > The 'value' already responds to the to_xml method and generates > perfectly fine XML. You didn't give us much to go on. What objects does the some_hash contain? Do you have sample output? -- Mark.