Latest 1.0.4
License MIT
Platforms ios 8.0, osx 10.10


SimpleXML is a simple XML parsing implementation for Swift 4+ projects.

SimpleXML provides a similar parsing implementation to JSONSerialization, the integrated Apple JSON parsing mechanism. Rather than building a potentially complex SAX style parsing mechanism for reading XML files tag by tag using XMLParser, you you can simply deserialize any XML file into convenient, familiar Dictionary, Array, and String structures.


Deserializing XML is easy. Given some example XML:


You can parse it like this:

  let url = URL(string: "http://some-xml-file.xml")
  let xmlData = try SimpleXML.parse(url)

  // Get the root node of the XML document.
  let root = xmlData["root"] as! [String:Any]

  // Get the child object of the root node.
  let child = root["child"] as! [String:Any]

  // Get the name string from the child node.
  let name = child["name"] as! String

  // Print "Dylan"


SimpleXML is built in Swift 4.0 and will run on iOS or macOS.


SimpleXML is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SimpleXML'


Dylan Neild, [email protected]


SimpleXML is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SimpleXML",
    "version": "1.0.4",
    "summary": "A simple library for parsing XML to a Swift native Dictionary tree.",
    "description": "A simple library for parsing XML to a Swift native Dictionary tree.nnThis library works similairly to the standard Swift JSON libraries - you provide it access to a stream, URL, or Data buffer of XML and it returns a [String:Any] dictionary that you can walk through easily.nnMore description and usage patterns forthcoming.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Dylan Neild": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.4"
    "platforms": {
        "ios": "8.0",
        "osx": "10.10"
    "source_files": "SimpleXML/Classes/*.swift",
    "pushed_with_swift_version": "4.0"

Pin It on Pinterest

Share This