How to remove name space from XML using Delphi 7
<p>i am using below code to remove name space attribute from xml but i didn;t succeeded.  i want to remove Namespace only from nodes <strong>Action__CompIntfc__CIName</strong></p>

<pre><code>&lt;Action__CompIntfc__CIName xmlns="http://schemas.xmlsoap.org/soap/encoding/"&gt;
</code></pre>

<p>Below is my code</p>

<pre><code>procedure TForm1.Button1Click(Sender: TObject);
var
  xmldoc : IXMLDOMDocument;
  xmlString : WideString;
  RecNodelist: IXMLDOMNodeList;
  DataNode: IXMLDOMElement;
  attr :  IXMLDOMAttribute;
begin
  xmlString := '&lt;?xml version="1.0"?&gt;'
  +'&lt;SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;'
    +'&lt;SOAP-ENV:Body&gt;'
      +'&lt;Action__CompIntfc__CIName xmlns="http://schemas.xmlsoap.org/soap/encoding/"&gt;'
        +'&lt;test&gt;1&lt;/test&gt;'
      +'&lt;/Action__CompIntfc__CIName&gt;'
      +'&lt;Action__CompIntfc__CIName xmlns="http://schemas.xmlsoap.org/soap/encoding/"&gt;'
        +'&lt;test&gt;15&lt;/test&gt;'
      +'&lt;/Action__CompIntfc__CIName&gt;'
    +'&lt;/SOAP-ENV:Body&gt;'
  +'&lt;/SOAP-ENV:Envelope&gt;';
  try
    XMLdoc := CoDOMDocument.Create;
    xmldoc.loadXML(xmlString);
    RecNodelist := XMLdoc.selectNodes('//SOAP-ENV:Envelope/SOAP-ENV:Body/Action__CompIntfc__CIName');
    DataNode := RecNodelist.NextNode as IXMLDOMElement;
    while DataNode &lt;&gt; nil do
    begin
      showmessage(DataNode.xml);
      attr := DataNode.getAttributeNode('xmlns');
      DataNode.removeAttributeNode(attr);
      showmessage(DataNode.xml);
      DataNode := RecNodelist.NextNode as IXMLDOMElement;
    end;
  except
   on e: Exception do
   begin
     ShowMessage(e.Message);
   end;
  end;
end;
</code></pre>

<p>After deleting namespace "xmlns="http://schemas.xmlsoap.org/soap/encoding/" from XML from below node</p>

<pre><code>&lt;Action__CompIntfc__CIName xmlns="http://schemas.xmlsoap.org/soap/encoding/"&gt;
</code></pre>

<p>i am expecting my xml to be</p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;SOAP-ENV:Body&gt;

    &lt;Action__CompIntfc__CIName&gt;
      &lt;test&gt;1&lt;/test&gt;
    &lt;/Action__CompIntfc__CIName&gt;

    &lt;Action__CompIntfc__CIName&gt;
      &lt;test&gt;15&lt;/test&gt;
    &lt;/Action__CompIntfc__CIName&gt;

  &lt;/SOAP-ENV:Body&gt;
&lt;/SOAP-ENV:Envelope&gt;
</code></pre>