I'd gladly contribute to a bounty for a proper C XPath implementation; I often miss one in pike. It's somewhat unfortunate that libxml2 isn't unicode sane, but the penalty for munging data back and forth through an utf8 codec might not be catastrophical.
Adding another dependent library to Pike core might not be kosher (I'd presume several or most others to be -1 rather than +0), but I would not personally mind libxml2's XPath implementation if there isn't a better one around.