Q:

Generate XML files with swift

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?

A:

You could use NSXMLDocument to write XML. For example:
import Foundation
let root = NSXMLElement(name: "root")
let xml = NSXMLDocument(rootElement: root)
root.addChild(NSXMLElement(name: "foo", stringValue:"bar"))
println(xml.XMLString)

A:

I made this new simple and lightweight XML parser for iOS in Swift - AEXML
You can use it to read XML data like this:
let someValue = xmlDocument["element"]["child"]["anotherChild"].value

or you can use it to build XML string like this:
let document = AEXMLDocument()
let element = document.addChild("element")
element.addChild("child")
document.xmlString // returns XML string of the entire document structure

NSXMLDocument works for OSX, but does not exist on iOS, so this will help in that case.

