title: Extract nodes data from xml
body: <p>I have an xml like this: </p>
  
  <pre><code>&lt;People&gt;
    &lt;PersonID&gt;5&lt;/PersonID&gt;
    &lt;PersonID&gt;7&lt;/PersonID&gt;
    &lt;PersonID&gt;9&lt;/PersonID&gt;
  &lt;/People&gt;
  </code></pre>
  
  <p>I would like to create a string with all the id's, like this: "5,7,9".
  I know it's possible with a simple loop, but since this code will be called 100's of time a second, I would like to make it the fastest possible way.</p>
  
  <p>I'm using <strong>C# framework 4.0.</strong></p>
  
  <p>My current code:</p>
  
  <pre><code>XmlDocument doc = new XmlDocument();
  XmlNodeList nodeList;
  StringBuilder strXml = new StringBuilder();
  doc.LoadXml(sXmlQuery);
  nodeList = doc.SelectNodes("//PersonID");
  if (nodeList != null)
  {
      foreach (XmlNode node in nodeList)
      {
          strXml.Append(node.InnerText.Trim());
          strXml.Append(",");
      }
  }
  </code></pre>