public static function createElementWithText(
        DOMDocument $document,
        string $name,
        string $text,
        array $attributes = []
    ): DOMElement {
        $element = self::createElement($document, $name, $attributes);
        $wrappedText = $document->createCDATASection($text);
        $element->appendChild($wrappedText);

        return $element;
    }