use DOMWrap\Document;
$html = <<<HTML
<ul>
<li>
<div>
<p>Outer 1</p>
<ul>
<li>Inner</li>
</ul>
</div>
</li>
<li>Outer 2</li>
<li>Outer 3</li>
</ul>
HTML;
$doc = new Document();
$doc->html($html);
// Accepts this selector, or errors out?
$nodes = $doc->find('> li');
// Or maybe this one, which is more standard?
$node = $doc->find(':scope > li');
// Returns '3' or '4'?
var_dump($nodes->count());