public static System.Xml.XPath.XPathNodeIterator GetNodeIt(System.Xml.XPath.XPathNavigator xnav, string xPath, System.Xml.XmlNamespaceManager nsmgr)
 {
     System.Xml.XPath.XPathExpression xpathExpr = xnav.Compile(xPath);
     if (nsmgr != null)
     {
         xpathExpr.SetContext(nsmgr);
     }
     return(xnav.Select(xpathExpr));
 }
 public static System.Xml.XPath.XPathNodeIterator GetSortedNodeIt(System.Xml.XPath.XPathNavigator xnav, string xPath, System.Xml.XmlNamespaceManager nsmgr, string sortXpath, bool isAscending, bool isCaseSensitive, bool isNumber)
 {
     System.Xml.XPath.XPathExpression xpathExpr = xnav.Compile(xPath);
     System.Xml.XPath.XmlSortOrder    sortOrder;
     System.Xml.XPath.XmlCaseOrder    caseOrder;
     System.Xml.XPath.XmlDataType     datatype;
     if (isAscending)
     {
         sortOrder = System.Xml.XPath.XmlSortOrder.Ascending;
     }
     else
     {
         sortOrder = System.Xml.XPath.XmlSortOrder.Descending;
     }
     if (isCaseSensitive)
     {
         caseOrder = System.Xml.XPath.XmlCaseOrder.UpperFirst;
     }
     else
     {
         caseOrder = System.Xml.XPath.XmlCaseOrder.None;
     }
     if (isNumber)
     {
         datatype = System.Xml.XPath.XmlDataType.Number;
     }
     else
     {
         datatype = System.Xml.XPath.XmlDataType.Text;
     }
     xpathExpr.AddSort(sortXpath, sortOrder, caseOrder, "", datatype);
     if (nsmgr != null)
     {
         xpathExpr.SetContext(nsmgr);
     }
     return(xnav.Select(xpathExpr));
 }