Add a Write function to write the data back to XML.