         }
     }
     
+    private func getDoubleValue(element: XMLElement, attribute: String) -> Double? {
+        guard let attributeValue = element.attributes[attribute], doubleValue = Double(attributeValue) else {
+            return .None
+        }
+        return doubleValue
+    }
+    
+    private func getIntValue(element: XMLElement, attribute: String) -> Int? {
+        guard let attributeValue = element.attributes[attribute], intValue = Int(attributeValue) else {
+            return .None
+        }
+        return intValue
+    }
+    
+    private func getFontName(attributes: [String: String]) -> String? {
+        return attributes["font-family"]
+    }
+    
+    private func getFontSize(attributes: [String: String]) -> Int? {
+        guard let fontSize = attributes["font-size"] else {
+            return .None
+        }
+        return Int(fontSize)
+    }
+    
+    private func getFontStyle(attributes: [String: String], style: String) -> Bool? {
+        guard let fontStyle = attributes["font-style"] else {
+            return .None
+        }
+        if fontStyle.lowercaseString == style {
+            return true
+        }
+        return false
+    }
+    
+    private func getFontWeight(attributes: [String: String], style: String) -> Bool? {
+        guard let fontWeight = attributes["font-weight"] else {
+            return .None
+        }
+        if fontWeight.lowercaseString == style {
+            return true
+        }
+        return false
+    }
+    
+    private func getTextDecoration(attributes: [String: String], decoration: String) -> Bool? {
+        guard let textDecoration = attributes["text-decoration"] else {
+            return .None
+        }
+        if textDecoration.containsString(decoration) {
+            return true
+        }
+        return false
+    }
+    
     private func concat(t1: Transform, t2: Transform) -> Transform {
         let nm11 = t2.m11 * t1.m11 + t2.m12 * t1.m21
         let nm21 = t2.m21 * t1.m11 + t2.m22 * t1.m21

        guard let element = line.element else {
            return .None
        }

        if let x1Attr = element.attributes["x1"],
            x2Attr = element.attributes["x2"],
            y1Attr = element.attributes["y1"],
            y2Attr = element.attributes["y2"],

            // Doubles
            x1 = Double(x1Attr),
            x2 = Double(x2Attr),
            y1 = Double(y1Attr),
            y2 = Double(y2Attr) {

                return Line(x1: x1, y1: y1, x2: x2, y2: y2)
        }

        return .None
    }

    private func parseRect(rect: XMLIndexer) -> Locus? {
        guard let element = rect.element else {
            return .None
        }

        if let widthAttr = element.attributes["width"],
            heightAttr = element.attributes["height"],

            // Doubles
            width = Double(widthAttr),
            height = Double(heightAttr) {

                var attributes: [String: Double] = [:]
                if let xAttr = element.attributes["x"], x = Double(xAttr) {
                    attributes["x"] = x
                }
                if let yAttr = element.attributes["y"], y = Double(yAttr) {
                    attributes["y"] = y
                }
                if let rxAttr = element.attributes["rx"], rx = Double(rxAttr) {
                    attributes["rx"] = rx
                }
                if let ryAttr = element.attributes["ry"], ry = Double(ryAttr) {
                    attributes["ry"] = ry
                }
                let resultRect = Rect(
                    x: attributes["x"] ?? 0,
                    y: attributes["y"] ?? 0,
                    w: width, h: height)

                if attributes["rx"] != nil || attributes["ry"] != nil {

                    return RoundRect(rect: resultRect,
                        rx: attributes["rx"] ?? 0,
                        ry: attributes["ry"] ?? 0)
                }

                return resultRect
        }

        return .None
    }

    private func parseCircle(circle: XMLIndexer) -> Circle? {
        guard let element = circle.element else {
            return .None
        }

        if let rAttr = element.attributes["r"],
            r = Double(rAttr) {

                var cx: Double = 0
                var cy: Double = 0
                if let cxAttr = element.attributes["cx"], circleX = Double(cxAttr) {
                    cx = circleX
                }
                if let cyAttr = element.attributes["cy"], circleY = Double(cyAttr) {
                    cy = circleY
                }

                return Circle(cx: cx, cy: cy, r: r)
        }

        return .None
    }

    private func parseEllipse(ellipse: XMLIndexer) -> Ellipse? {
        guard let element = ellipse.element else {
            return .None
        }

        if let rxAttr = element.attributes["rx"],
            ryAttr = element.attributes["ry"],

            // Doubles
            rx = Double(rxAttr),
            ry = Double(ryAttr) {

                var cx: Double = 0
                var cy: Double = 0
                if let cxAttr = element.attributes["cx"], ellipseX = Double(cxAttr) {
                    cx = ellipseX
                }
                if let cyAttr = element.attributes["cy"], ellipseY = Double(cyAttr) {
                    cy = ellipseY
                }

                return Ellipse(cx: cx, cy: cy, rx: rx, ry: ry)
        }

        return .None
    }

    private func parsePolygon(polygon: XMLIndexer) -> Polygon? {

    private func parseNode(node: XMLIndexer, groupStyle: [String: String] = [:], groupPosition: Transform = Transform()) -> Node? {
        if let element = node.element {
            if node.children.isEmpty {
                return parseElement(node, groupStyle: groupStyle, groupPosition: groupPosition)
            } else if element.name == "g" {
                return parseGroup(node, groupStyle: groupStyle, groupPosition: groupPosition)
            }
