title: How to get specific value from a xml string in c#
body: <p>I have following string </p>
  
  <pre><code>&lt;SessionInfo&gt;
    &lt;SessionID&gt;MSCB2B-UKT3517_f2823910df-5eff81-528aff-11e6f-0d2ed2408332&lt;/SessionID&gt;
    &lt;Profile&gt;A&lt;/Profile&gt;
    &lt;Language&gt;ENG&lt;/Language&gt;
    &lt;Version&gt;1&lt;/Version&gt;
  &lt;/SessionInfo&gt;
  </code></pre>
  
  <p>now I want to get the <strong>value</strong> of <strong>SessionID</strong>. I tried with below ..</p>
  
  <pre><code>var rootElement = XElement.Parse(output);//output means above string and this step has values
  </code></pre>
  
  <p>but in here,,</p>
  
  <pre><code>var one = rootElement.Elements("SessionInfo");
  </code></pre>
  
  <p>it didn't work.what can I do that.</p>
  
  <p>and What if the xml string like below.can we use same to get the <strong>sessionID</strong></p>
  
  <pre><code>&lt;DtsAgencyLoginResponse xmlns="DTS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="DTS file:///R:/xsd/DtsAgencyLoginMessage_01.xsd"&gt;
    &lt;SessionInfo&gt;
      &lt;SessionID&gt;MSCB2B-UKT351ff7_f282391ff0-5e81-524548a-11eff6-0d321121e16a&lt;/SessionID&gt;
      &lt;Profile&gt;A&lt;/Profile&gt;
      &lt;Language&gt;ENG&lt;/Language&gt;
      &lt;Version&gt;1&lt;/Version&gt;
    &lt;/SessionInfo&gt;
    &lt;AdvisoryInfo /&gt;
  &lt;/DtsAgencyLoginResponse&gt;
  </code></pre>