This is a little demonstration for the PhpCss library. It parses CSS 3 selectors and converts them into Xpath expressions. It has full support for CSS 3, except for selectors that depend on user interaction (:hover) or do not return a node (:first-line).
The target of this library is to create working expressions for any CSS selector. The expressions are not optimized in any way. Creating them manually will result in expressions that are a lot easier to read.