protected function createStreamWriter(string $xmlExtension): XmlStreamWriter
    {
        $className = $this->types[$xmlExtension];
        return new $className($this->version, $this->encoding);
    }