I noticed a few people getting desperate about XPath/XSLT 2.0 support in Python, especially since the normal sources like XML-SIG or comp.lang.python magically failed to provide helpful answers in the past.

A good place to look is the web site of the W3C XQuery group, which has a general and quite comprehensive list of XQuery 1.0 implementations. By design, these also implement XPath 2.0. Now, some of them provide their XPath2 support separately, some additionally implement XSLT2, and some even seem to have Python bindings. So there should at least be something useful to start from.

Another take on this: while some implementations are in C (just as the CPython interpreter) or at least C++, many others are written in Java. GNU's gcj is pretty good in compiling such tools and libraries into executable binaries and it also has support for generating the necessary C headers. What I'd love to see is one of the good XPath2/XQuery tools compiled as a Python extension and/or interfaced with lxml at the C level.

One project that did something like that was PyLucene. They now seem to have switched to a new tool called JCC, which (according to the docs) generates a complete CPython extension from a Java application that interfaces with the JVM through the JNI. While I like the simplicity of this (I haven't used it yet), I would still prefer a GCJ compiled binary over a dependency on a full-fledged JVM. But I definitely like both approaches. Any volunteers? :)