} /**
* @throws \InvalidArgumentException
*/
private function createDOMXPath(\DOMDocument
$document, array
$prefixes =
[]): \DOMXPath
{ $domxpath =
new \
DOMXPath($document);
foreach ($prefixes as $prefix) { $namespace =
$this->
discoverNamespace($domxpath,
$prefix);
if (null !==
$namespace) { $domxpath->
registerNamespace($prefix,
$namespace);
} } return $domxpath;
} /**
* @throws \InvalidArgumentException
*/