             config.shouldProcessNamespaces = true
         }
         let parsedXml = config.parse(xmlString)
-        
-        var svgElement: XMLElement!
+
+        var svgElement: XMLElement?
         for child in parsedXml.children {
             if let element = child.element {
                 if element.name == "svg" {

                }
            }
        }
        try parseSvg(parsedXml.children)
        
        var group: Group
        if let layout = try parseViewBox(svgElement!) {
            group = SVGCanvas(layout: layout, contents: nodes)
        } else {
            group = Group(contents: nodes)
        }
        
        // global opacity
        if let opacity = svgElement.attribute(by: "opacity") {
            group.opacity = Double(opacity.text)!
        }
        
        return group
    }

    fileprivate func prepareSvg(_ children: [XMLIndexer]) throws {


    fileprivate func getOpacity(_ styleParts: [String: String]) -> Double {
        if let opacityAttr = styleParts["opacity"] {
            return getOpacity(opacityAttr)
        }
        return 1
    }

    fileprivate func getOpacity(_ opacity: String) -> Double {
        return Double(opacity.replacingOccurrences(of: " ", with: "")) ?? 1
    }

    fileprivate func parseLine(_ line: XMLIndexer) -> Line? {
