Simply using a SAX parser will not build a representation of your XML tree in memory (this is why SAX is more memory-efficient). It will only trigger "events" whenever a new XML element is encountered. You will have to keep the context (often a stack of parent elements) in memory to "know" where you are in the tree.
Since you will not have a tree in memory, you will not be able to use XPath. You can only test for the current "context" (your manuallay managed stack) to query your document.Remember that the SAX parser will only do one run on your file, so order in the file is important.
Fortunately, there are other approach like VTD-XML which is a library that build the XML tree in memory, but only the structure part, it does not extract the actual content from the file, the content is extracted as-needed. It is much more memory efficient than a DOM parser while still allowing XPath. I personnaly use this library at work to parse ~700MB XML files with XPath (yes that's insane but it works and it is very fast.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…