How can I create XML files "manually" using swift? Is there any library that I can use? I saw that in objc it's possible to add libxml but even with that I can't find any good documentation on it. Any suggestions?
You could use XMLDocument to write XML. For example:
import Foundation
let root = XMLElement(name: "root")
let xml = XMLDocument(rootElement: root)
root.addChild(XMLElement(name: "foo", stringValue:"bar"))
print(xml.xmlString)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With