Bookmarked Creating an xml file with a script from google spreadsheet (Stack Overflow)

You need to create an xml file with a script from google spreadsheets. I use the code from these two topics:

Google Script Export Spreadsheet to XML File

Looking to create an XML feed from a Google Sheet Table

I was asked about the ability to export the results from a Google Form as an XML file. I found this script which gets me part of the way there, I just need to work out how do produce child elements.