I wrote as an XPath parser and implementation of IXPathNavigable (I used to be an XMLPrime developer). Nothing is easy; and I suspect that IXPathNavigable will not be the cheap victory you are hoping for, as there is a lot of subtlety in the interactions between the various methods - I suspect that a full XPath analyzer will be simpler (and more reliable).
To answer your question:
var results xpathNavigable.CreateNavigator().Evaluate("/my/xpath[expression]").
You will probably need to list the results to force node navigation.
If you always returned true, then all you know about the next XPath is that it is looking for foo child bars: foo[not(bar)]/other/elements
If you always return a fixed number of nodes, then you will never know about most of this XPath a[100]/b/c/
Essentially, this will not work.
Oliver hallam
source share