Initial exploration shows the [XML_builder](https://github.com/joshnuss/xml_builder) library that can help you create xml strings. Seems well suited for our purpose.