When initializing a writer in C TCMXMLWriter *writer = [[TCMXMLWriter alloc] initWithOptions:TCMXMLWriterOptionPrettyPrinted]; was used which worked as expected.
In Swift var writer = TCMXMLWriter(options: TCMXMLWriterOptionPrettyPrinted) will not compile and gives error "Cannot invoke 'init' with an argument list of type '(options: Int)'
A workaround is to initialize with var writer = TCMXMLWriter(options: 1), this worked as expected