public static function createElement(DOMDocument $document, $name, array $attributes = []): DOMElement
    {
        $element = $document->createElement($name);

        foreach ($attributes as $attribName => $attribValue) {
            $element->setAttribute($attribName, $attribValue);
        }

        return $element;
    }