Made some real progress on this in the last couple of days. I've added a new AxisEnumerator class - give it a context node and an axis specifier and it'll enumerate that axis. Well, almost - so far it does child, attribute, following-sibling, preceding-sibling and self. Once I knock up a node test class (some for node name) I can go ahead and implement location step - that's a 'real' XPath. Hurrah.
This AxisEnumerator interface falls somewhere between an STL style iterator and Java enumerator. I'm not entirely happy with it, but it does the job at the moment. I need to look at similar iterator/enumerator classes - there's probably something in boost somewhere. I don't want to bodge this too much, because it'll be useful in its own right outside of the XPath engine.