private function parseNode(\SimpleXMLElement $xml, array $namespaces)
    {
        $type = $xml->getName();

        if (isset(self::$nodeTypes[$type])) {
            $call = array(self::$nodeTypes[$type], 'constructFromAttributes');
            $node = call_user_func($call, $xml);
        } else {
            $node = new SVGGenericNodeType($type);
        }

        $this->applyAttributes($node, $xml, $namespaces);
        $this->applyStyles($node, $xml);
        $node->setValue($xml);

        if ($node instanceof SVGNodeContainer) {
            $this->addChildren($node, $xml, $namespaces);
        }

        return $node;
    }