The CssParser class lets us to work with CSS Selector expressions. For example:
<?php
// loads an xml document and returns the nodes
// the function 'query' returns an array of DOMElement objects
$parser = new CssParser("doc.xml");
$nodes = $parser->query("books item:not(books item.sci-fi[author_id ^= arthur])");
// prints nodes
foreach ($nodes as $node) {
echo $parser->dom2str($node) . "\n~~~\n";
}
?>