<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.7.0" />

XmlDocumentXPathExtensions

public static class XmlDocumentXPathExtensions
Provides extension methods for the XmlDocument and XmlNode for document navigation.
public static XPathNavigator CreateNavigator(this XmlNode node)

Creates an XPath navigator for navigating the specified node.

public static XPathNavigator CreateNavigator(this XmlDocument document)

Creates a new XPath navigator object for navigating the specified document.

public static XPathNavigator CreateNavigator(this XmlDocument document, XmlNode node)

Creates an XPath navigator object for navigating the specified document positioned on the specified node.

public static XmlNodeList SelectNodes(this XmlNode node, string xpath)

Selects a list of nodes matching the specified XPath expression.

public static XmlNodeList SelectNodes(this XmlNode node, string xpath, XmlNamespaceManager nsmgr)

Selects a list of nodes matching the specified XPath expression. Any prefixes found in the XPath expression are resolved using the supplied namespace manager.

public static XmlNode SelectSingleNode(this XmlNode node, string xpath)

Selects the first node that matches the XPath expression.

public static XmlNode SelectSingleNode(this XmlNode node, string xpath, XmlNamespaceManager nsmgr)

Selects the first node that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied namespace manager.

public static IXPathNavigable ToXPathNavigable(this XmlNode node)

Creates an IXPathNavigable instance used for producing navigators.