From: Chris Gallagher Date: 2008-07-25T01:09:57+09:00 Subject: Output an array as XML Hi, Im currently trying to build a sitemap.xml file with ruby code. at the moment i have an array containing urls so @urls = ["http://www.google.com", "http://yahoo.com"] etc... What i want to do is to loop through these and output them into the following xml structure: http://www.google.com Im currently trying to do it with builder and have the following: @sitemap = Builder::XmlMarkup.new() @sitemap.instruct! @sitemap.declare! :DOCTYPE, :html, :PUBLIC, "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" @sitemap.urlset("xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9") im at the point where i need to take the @urls and insert them in between the urlset element. any ideas on how i might do this? Cheers -- Posted via http://www.ruby-forum.com/.