Serializes the dictionary to an XML string