title: How to get a list of values on a XML response?
body: <p>I get from a webservice a XML like this:</p>
  <pre><code>&lt;s:Envelope
      xmlns:s=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
      &lt;s:Body&gt;
          &lt;Get_PersonResponse
              xmlns=&quot;http://tempuri.org/&quot;&gt;
              &lt;Get_PersonResult
                  xmlns:a=&quot;http://schemas.datacontract.org/example&quot;
                  xmlns:i=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
                  &lt;a:LASTNAME&gt;DOE&lt;/a:LASTNAME&gt;
                  &lt;a:EMAIL/&gt;
                  &lt;a:FIRSTNAME&gt;JONH&lt;/a:FIRSTNAME&gt;
                  &lt;a:NUM_CARD/&gt;
                  &lt;a:ID_PERSON&gt;12345456&lt;/a:ID_PERSON&gt;
                  &lt;a:PHONE/&gt;
              &lt;/Get_PersonResult&gt;
              &lt;RESP_COMMENT&gt;&quot;Person found&quot;&lt;/RESP_COMMENT&gt;
          &lt;/Get_PersonResponse&gt;
      &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  <p>I want to check if RESP_COMMENT is empty. Then if is not empty get all the values (a:FIRSTNAME, a:LASTNAME, etc)</p>
  <p>I got the a:FIRSTNAME on the fiddle but I am not sure if I have to do a bucle for every single value or is a better way to do it:</p>
  <p><a href="https://dotnetfiddle.net/cOsX6s" rel="nofollow noreferrer">https://dotnetfiddle.net/cOsX6s</a></p>
  <pre><code>XmlDocument xmldoc = new XmlDocument();
  xmldoc.LoadXml(output);
  XmlNodeList nodeList = xmldoc.GetElementsByTagName(&quot;a:FIRSTNAME&quot;);
  string lastname = string.Empty;
  foreach (XmlNode node in nodeList)
  {
      firstname = node.InnerText;
      Console.Write(firstname);
  }
  </code></pre>