Although it is theoretically possible to build a stream reader that has executed an XPath request for a stream, I don't know of any such implementation; XPath processors in the .NET platform (in XDocument , XmlDocument and XPathDocument ) all read the document into memory before executing the request. All of these objects can read streams.
If speed is a problem, XPathDocument and XPathNavigator are likely to be the fastest, as these objects allow you to directly iterate over nodes as you execute the query, rather than run the query and return a list of nodes for you to iterate over. (Actually XDocument.XPathEvaluate can do this too, the documentation does not say.)
source share