title: Computing a value from an XPathNavigator
body: <p>I am trying to write a function for my XSL Transform.</p>
  
  <p>Basically within the function I have a <code>System.Xml.XPath.XPathNodeIterator</code> and I want to get the value of an XPath when applied to each of the nodes within that iterator.</p>
  
  <p>In this instance the XPath is <code>concat(name(.) , "_", string(.))</code> but it could actually be anything.</p>
  
  <p>This is throwing an XPathException: "Expression must evaluate to a node-set."
  Which kind of makes some sense</p>
  
  <p>I suspect I'm going to be told this is not a valid XPath but is some other xml/xsl related functionality however, consider that in XSL I can do this:</p>
  
  <pre><code>&lt;xsl:value-of select="concat(name(.) , "_", string(.))"/&gt;
  </code></pre>
  
  <p>And that is what I'm after - but within the function.</p>
  
  <p>I'm using C# but VB answers are acceptable.</p>
  
  <pre><code>System.Xml.XPath.XPathNodeIterator Nodes = whatever;
  string KeySelector="concat(name(.), '_', string(.))";
  while (Nodes.MoveNext())
  {
      System.Xml.XPath.XPathNavigator xpnValue = Nodes.Current.SelectSingleNode(KeySelector);
  }
  </code></pre>