protected function setNonEmptyAttribute(\DomElement $element, string $name, string $value = null) : void
    {
        if (! is_null($value)) {
            $element->setAttribute($name, $value);
        }
    }