 		}
 		return width
 	}
+    
+    private func parseLine(line: XMLIndexer) -> Line? {
+        if let x1Attr = line.element!.attributes["x1"], x2Attr = line.element!.attributes["x2"],
+            y1Attr = line.element!.attributes["y1"], y2Attr = line.element!.attributes["y2"],
+            x1 = Double(x1Attr), x2 = Double(x2Attr), y1 = Double(y1Attr), y2 = Double(y2Attr) {
+            return Line(x1: x1, y1: y1, x2: x2, y2: y2)
+        }
+        return nil
+    }
+    
+    private func parseRect(rect: XMLIndexer) -> Locus? {
+        if let widthAttr = rect.element!.attributes["width"], heightAttr = rect.element!.attributes["height"],
+            width = Double(widthAttr), height = Double(heightAttr) {
+            var attributes: [String:Double] = [:]
+            if let xAttr = rect.element!.attributes["x"], x = Double(xAttr) {
+                attributes["x"] = x
+            }
+            if let yAttr = rect.element!.attributes["y"], y = Double(yAttr) {
+                attributes["y"] = y
+            }
+            if let rxAttr = rect.element!.attributes["rx"], rx = Double(rxAttr) {
+                attributes["rx"] = rx
+            }
+            if let ryAttr = rect.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 nil
+    }
+    
+    private func parseCircle(circle: XMLIndexer) -> Circle? {
+        if let attributes = circle.element?.attributes, rAttr = attributes["r"], r = Double(rAttr) {
+            var cx: Double = 0
+            var cy: Double = 0
+            if let cxAttr = attributes["cx"], circleX = Double(cxAttr) {
+                cx = circleX
+            }
+            if let cyAttr = attributes["cy"], circleY = Double(cyAttr) {
+                cy = circleY
+            }
+            return Circle(cx: cx, cy: cy, r: r)
+        }
+        return nil
+    }
+    
+    private func parseEllipse(ellipse: XMLIndexer) -> Ellipse? {
+        if let attributes = ellipse.element?.attributes, rxAttr = attributes["rx"], rx = Double(rxAttr),
+            ryAttr = attributes["ry"], ry = Double(ryAttr) {
+            var cx: Double = 0
+            var cy: Double = 0
+            if let cxAttr = attributes["cx"], ellipseX = Double(cxAttr) {
+                cx = ellipseX
+            }
+            if let cyAttr = attributes["cy"], ellipseY = Double(cyAttr) {
+                cy = ellipseY
+            }
+            return Ellipse(cx: cx, cy: cy, rx: rx, ry: ry)
+        }
+        return nil
+    }
+    
+    private func parsePolygon(polygon: XMLIndexer) -> Polygon? {
+        if let points = polygon.element?.attributes["points"] {
+            return Polygon(points: parsePoints(points))
+        }
+        return nil
+    }
+    
+    private func parsePolyline(polyline: XMLIndexer) -> Polyline? {
+        if let points = polyline.element?.attributes["points"] {
+            return Polyline(points: parsePoints(points))
+        }
+        return nil
+    }
+    
+    private func parsePoints(pointsString: String) -> [Double] {
+        var resultPoints: [Double] = []
+        let pointPairs = pointsString.componentsSeparatedByString(" ")
+        for pointPair in pointPairs {
+            let points = pointPair.componentsSeparatedByString(",")
+            for point in points {
+                if let resultPoint = Double(point) {
+                    resultPoints.append(resultPoint)
+                }
+            }
+        }
+        return resultPoints
+    }
 
 	private func parsePath(path: XMLIndexer) -> Path? {
 		if let dAttr = path.element!.attributes["d"] {

	let curveToRelative = Character("c")
	let closePathAbsolute = Character("Z")
	let closePathRelative = Character("z")

	private let xmlString: String
	private let position: Transform

	private var shapes = [Shape]()

	private enum PathCommandType {
		case MoveTo

		iterateThroughXmlTree(parsedXml.children)

		let group = Group(
			contents: self.nodes
		)
		return group
	}
