title: remove soap envelope header and get the XML
body: <p>I have a soap response, I want to remove all soap related things and get the inner XML with only one header.</p>
  <p>response:</p>
  <pre><code>&quot;&lt;s:Envelope xmlns:xsd=&quot;&quot;http://www.w3.org/2001/XMLSchema&quot;&quot; xmlns:xsi=&quot;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&quot; xmlns:s=&quot;&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&quot;&gt;
      &lt;s:Body&gt;
          &lt;getResponse xmlns = &quot;&quot;http://tempuri.org/&quot;&quot;&gt;
              &lt;getResult xmlns:xsi = &quot;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&quot; xmlns:xsd = &quot;&quot;http://www.w3.org/2001/XMLSchema&quot;&quot;&gt;
                  &lt;Id&gt;999&lt;/Id&gt;
                  &lt;EResponse&gt;
                      &lt;au&gt;
                          &lt;st&gt;ABC&lt;/st&gt;
                          &lt;co&gt;DGH&lt;/co&gt;
                          &lt;mo&gt;MMM&lt;/mo&gt;
                      &lt;/au&gt;
           &lt;/EResponse&gt;
              &lt;/getResult&gt;
          &lt;/getResponse&gt;
      &lt;/s:Body&gt;
  &lt;/s:Envelope&gt; 
            
  </code></pre>
  <p>I want to extract this:</p>
  <pre><code>&lt;getResult xmlns:xsi = &quot;&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&quot; xmlns:xsd = &quot;&quot;http://www.w3.org/2001/XMLSchema&quot;&quot;&gt;
                  &lt;Id&gt;999&lt;/Id&gt;
                  &lt;EResponse&gt;
                      &lt;au&gt;
                          &lt;st&gt;ABC&lt;/st&gt;
                          &lt;co&gt;DGH&lt;/co&gt;
                          &lt;mo&gt;MMM&lt;/mo&gt;
                      &lt;/au&gt;
           &lt;/EResponse&gt;
              &lt;/getResult&gt;
  </code></pre>
  <p>I am trying this:</p>
  <pre><code>XDocument input;
  
        using (var nodeReader = new XmlNodeReader(doc))
          {
              nodeReader.MoveToContent();
              input = XDocument.Load(nodeReader);
          }
  
          var xns = XNamespace.Get(&quot;http://tempuri.org/&quot;);
          var SoapBody = input.Descendants(xns + &quot;getResult&quot;).First().ToString();
  </code></pre>
  <p>but I am also getting namespace tempuri appended in getresult tag, which I don't want or any other way to achieve it  ?</p>