         return .None
     }
 
-    private func parseShape(shape: XMLIndexer, groupStyle: [String: String] = [:], groupPosition: Transform = Transform()) -> Shape? {
-        if let element = shape.element {
+    private func parseElement(node: XMLIndexer, groupStyle: [String: String] = [:], groupPosition: Transform = Transform()) -> Node? {
+        if let element = node.element {
             let styleAttributes = getStyleAttributes(groupStyle, element: element)
             let position = getPosition(groupPosition, element: element)
             switch element.name {
             case "path":
-                if let path = parsePath(shape) {
+                if let path = parsePath(node) {
                     return Shape(form: path, fill: getFillColor(styleAttributes), stroke: getStroke(styleAttributes), pos: position)
                 }
             case "line":
-                if let line = parseLine(shape) {
+                if let line = parseLine(node) {
                     return Shape(form: line, fill: getFillColor(styleAttributes), stroke: getStroke(styleAttributes), pos: position)
                 }
             case "rect":
-                if let rect = parseRect(shape) {
+                if let rect = parseRect(node) {
                     return Shape(form: rect, fill: getFillColor(styleAttributes), stroke: getStroke(styleAttributes), pos: position)
                 }
             case "circle":
-                if let circle = parseCircle(shape) {
+                if let circle = parseCircle(node) {
                     return Shape(form: circle, fill: getFillColor(styleAttributes), stroke: getStroke(styleAttributes), pos: position)
                 }
             case "ellipse":
-                if let ellipse = parseEllipse(shape) {
+                if let ellipse = parseEllipse(node) {
                     return Shape(form: ellipse, fill: getFillColor(styleAttributes), stroke: getStroke(styleAttributes), pos: position)
                 }
             case "polygon":
-                if let polygon = parsePolygon(shape) {
+                if let polygon = parsePolygon(node) {
                     return Shape(form: polygon, fill: getFillColor(styleAttributes), stroke: getStroke(styleAttributes), pos: position)
                 }
             case "polyline":
-                if let polyline = parsePolyline(shape) {
+                if let polyline = parsePolyline(node) {
                     return Shape(form: polyline, fill: getFillColor(styleAttributes), stroke: getStroke(styleAttributes), pos: position)
                 }
+            case "image":
+                return parseImage(node, pos: position)
+            case "text":
+                return parseText(node, fill: getFillColor(styleAttributes), fontName: getFontName(styleAttributes), fontSize: getFontSize(styleAttributes),
+                                 italic: getFontStyle(styleAttributes, style: "italic"), bold: getFontWeight(styleAttributes, style: "bold"),
+                                 underline: getTextDecoration(styleAttributes, decoration: "underline"), strike: getTextDecoration(styleAttributes, decoration: "line-through"), pos: position)
             default:
                 print("SVG parsing error. Shape \(element.name) not supported")
                 return .None

        }

        return resultPoints
    }

    private func parsePath(path: XMLIndexer) -> Path? {

        guard let element = line.element else {
            return .None
        }
        
        return Line(x1: getDoubleValue(element, attribute: "x1") ?? 0,
                    y1: getDoubleValue(element, attribute: "y1") ?? 0,
                    x2: getDoubleValue(element, attribute: "x2") ?? 0,
                    y2: getDoubleValue(element, attribute: "y2") ?? 0)
    }

    private func parseRect(rect: XMLIndexer) -> Locus? {
        guard let element = rect.element,
            width = getDoubleValue(element, attribute: "width"),
            height = getDoubleValue(element, attribute: "height")
            where width > 0 && height > 0  else {
                
                return .None
        }
        
        let resultRect = Rect(x: getDoubleValue(element, attribute: "x") ?? 0, y: getDoubleValue(element, attribute: "y") ?? 0, w: width, h: height)
        
        let rxOpt = getDoubleValue(element, attribute: "rx")
        let ryOpt = getDoubleValue(element, attribute: "ry")
        if let rx = rxOpt, ry = ryOpt {
            return RoundRect(rect: resultRect, rx: rx, ry: ry)
        }
        let rOpt = rxOpt ?? ryOpt
        if let r = rOpt where r >= 0 {
            return RoundRect(rect: resultRect, rx: r, ry: r)
        }
        return resultRect
    }

    private func parseCircle(circle: XMLIndexer) -> Circle? {
        guard let element = circle.element, r = getDoubleValue(element, attribute: "r") where r > 0 else {
            return .None
        }
        
        return Circle(cx: getDoubleValue(element, attribute: "cx") ?? 0, cy: getDoubleValue(element, attribute: "cy") ?? 0, r: r)
    }

    private func parseEllipse(ellipse: XMLIndexer) -> Ellipse? {
        guard let element = ellipse.element,
            rx = getDoubleValue(element, attribute: "rx"),
            ry = getDoubleValue(element, attribute: "ry")
            where rx > 0 && ry > 0 else {
                
                return .None
        }
        
        return Ellipse(cx: getDoubleValue(element, attribute: "cx") ?? 0, cy: getDoubleValue(element, attribute: "cy") ?? 0, rx: rx, ry: ry)
    }

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