From: rb Date: 2006-12-30T00:35:05+09:00 Subject: XML - converting from one feed to another (beginner) I'm trying to read an XML feed of products and convert them to a different XML feed to upload to Froogle (Google Base). How do I read the lines of XML and then rewrite them in the new XML? I've started with rexml, but I'm not sure if I'm on the right track. def convert_to_base_xml(xml) # Takes a product XML feed and converts it into one that # is formatted for uploading to Google Base # doc = REXML::Document.new feed = REXML::Document.new(xml) # Create the export XML document doc = REXML:Document.new rss = doc.add_element 'rss' channel = doc.add_element 'channel' # Loop through old feed and create new feed based # on that data feed.each_child do |child| #add items to new rss feed, see below # I'm not sure what I should do here end # Save rss feed to a file end # original feed XML # # # # # # # # # # # # # # # # Convert to an RSS 2.0 feed in this format: # # # # # # # # # # # #