A smarter remake of xPath.