private static function getStringElement(\DOMElement $parent, string $name) : ?string
    {
        $e = self::getStringElements($parent, $name);
        if (empty($e)) {
            return null;
        }
        if (count($e) > 1) {
            throw new \Exception('More than one '.$name.' in '.$parent->tagName);
        }

        return $e[0];
    }
private static function getStringElement(\DOMElement $parent, string $name) : ?string
    {
        $e = self::getStringElements($parent, $name);
        if (empty($e)) {
            return null;
        }
        if (count($e) > 1) {
            throw new \Exception('More than one '.$name.' in '.$parent->tagName);
        }

        return $e[0];
    }
private static function getStringElement ( \ DOMElement $ parent , string $ name ) : ? string { $ e = self :: getStringElements ( $ parent , $ name ) ; if ( empty ( $ e ) ) { return null ; } if ( count ( $ e ) > 1 ) { throw new \ Exception ( 'More than one ' . $ name . ' in ' . $ parent -> tagName ) ; } return $ e [ 0 ] ; }
Retrieve the value of a child \DOMElement as a string.

@param  \DOMElement  $parent The parent element.
@param  string      $name   The name of the child element.
@throws \Exception
@return string|null The value of the child element.
Retrieve the value of a child \ DOMElement as a string .