src/SimpleDOM.php
public function firstOf($xpath)
    {
        $nodes = $this->xpath($xpath);
        return (isset($nodes[0])) ? $nodes[0] : null;
    }
public function firstOf($xpath)
    {
        $nodes = $this->xpath($xpath);
        return (isset($nodes[0])) ? $nodes[0] : null;
    }
Return the first node of the result of an XPath expression

@param    string $xpath XPath expression
@return    mixed            SimpleDOM object if any node was returned, NULL otherwise