 
     /// The underlying XMLElement at the currently indexed level of XML.
     public var element: XMLElement? {
-    get {
-        switch self {
-        case .Element(let elem):
-            return elem
-        default:
-            return nil
-        }
-    }
+        get {
+            switch self {
+            case .Element(let elem):
+                return elem
+            default:
+                return nil
+            }
+        }
     }
 
     /// The underlying array of XMLElements at the currently indexed level of XML.
     public var all: [XMLIndexer] {
-    get {
-        switch self {
-        case .List(let list):
-            var xmlList = [XMLIndexer]()
-            for elem in list {
-                xmlList.append(XMLIndexer(elem))
-            }
-            return xmlList
-        case .Element(let elem):
-            return [XMLIndexer(elem)]
-        default:
-            return []
-        }
-    }
-    }
-
-    /**
-        Allows for element lookup by matching attribute values.
-
-        :param: attr should the name of the attribute to match on
-        :param: _ should be the value of the attribute to match on
-
-        :returns: instance of XMLIndexer
+        get {
+            switch self {
+            case .List(let list):
+                var xmlList = [XMLIndexer]()
+                for elem in list {
+                    xmlList.append(XMLIndexer(elem))
+                }
+                return xmlList
+            case .Element(let elem):
+                return [XMLIndexer(elem)]
+            default:
+                return []
+            }
+        }
+    }
+    }
+
+    /**
+    Allows for element lookup by matching attribute values.
+
+    :param: attr should the name of the attribute to match on
+    :param: _ should be the value of the attribute to match on
+
+    :returns: instance of XMLIndexer
     */
     public func withAttr(attr: String, _ value: String) -> XMLIndexer {
         let attrUserInfo = [NSLocalizedDescriptionKey: "XML Attribute Error: Missing attribute [\"\(attr)\"]"]

    /// The attributes of the element
    public var attributes = [String:String]()

    var elements = [String:[XMLElement]]()

    /**
        Initialize an XMLElement instance

        :param: name The name of the element to be initialized

        :returns: a new instance of XMLElement
    */
    init(name: String) {
        self.name = name
    }

    /**
        Adds a new XMLElement underneath this instance of XMLElement

        :param: name The name of the new element to be added
        :param: withAttributes The attributes dictionary for the element being added

        :returns: The XMLElement that has now been added
    */
    func addElement(name: String, withAttributes attributes: NSDictionary) -> XMLElement {
        let element = XMLElement(name: name)

        if var group = elements[name] {
            group.append(element)
            elements[name] = group
        }
        else {
            elements[name] = [element]
        }

        for (keyAny,valueAny) in attributes {

    }

    /**
    Find an XML element at the current level by element name

    :param: key The element name to index by

    :returns: instance of XMLIndexer to match the element (or elements) found by key
    */
    public subscript(key: String) -> XMLIndexer {
        get {
            let userInfo = [NSLocalizedDescriptionKey: "XML Element Error: Incorrect key [\"\(key)\"]"]
            switch self {
            case .Element(let elem):
                if let match = elem.children[key] {
                    if match.count == 1 {
                        return .Element(match[0])
                    }
