Writes configuration for a provided config object and returns the serialized data as a string.