private function createDocument(?string $version = null, ?string $encoding = null): \DOMDocument
    {
        $doc = new \DOMDocument($version ?: $this->defaultVersion, $encoding ?: $this->defaultEncoding);
        $doc->formatOutput = true;

        return $doc;
    }
private function createDocument(?string $version = null, ?string $encoding = null): \DOMDocument
    {
        $doc = new \DOMDocument($version ?: $this->defaultVersion, $encoding ?: $this->defaultEncoding);
        $doc->formatOutput = true;

        return $doc;
    }
private function createDocument ( ? string $ version = null , ? string $ encoding = null ) : \ DOMDocument { $ doc = new \ DOMDocument ( $ version ? : $ this -> defaultVersion , $ encoding ? : $ this -> defaultEncoding ) ; $ doc -> formatOutput = true ; return $ doc ; }
Create a new document object.

@param string|null $version
@param string|null $encoding

@return \DOMDocument
Create a new document object .