title: How to get a substring of a node in an Xpath expression
body: <p>I'm passing an xpath expression to a XmlDocument and calling SelectNodes(expression) - I'm trying to return just the substring.  So far I've tried</p>
  
  <pre><code>substring(//Container/__name,2)
  substring(//Container/__name/text(),2)
  //Container/__name/substring(.,2)
  //Container/__name/text()/substring(.,2)
  </code></pre>
  
  <p>(You can see I'm getting desperate).</p>
  
  <p>They all give errors ("Expression must evaluate to a node set")</p>
  
  <p>//Container/__name/text() works, by the way (and it's 6 characters long).</p>
  
  <p>What's the right way to do this?</p>
  
  <p>EDIT:
  Here's the exact code (nothing too spectacular)</p>
  
  <pre><code>nodeList = xdoc.SelectNodes(xpathBox.Text);
  </code></pre>
  
  <p>I'm really trying to come up with a pure xpath solution - this is a utility that allows an xml document to be modified by providing an xpath expression and a string - the string is the replacement for the text in the node selected by the xpath expression.  I want to be able to do partial replacements.  So, if what this is not possible, is there any suggestion about how to most elegantly accomplish my goal: replace part of a text node with a string, using only an xpath expression and a string.  Another function perhaps?</p>