protected function appendNonEmptyChild(\DomDocument $document, \DOMElement $element, string $name, string $value = null) : void
    {
        if (! is_null($value)) {
            $element->appendChild($document->createElement($name, $value));
        }
    }