title: how to search for a text in xml file and delete that line using xslt
body: <p>I want to learn how to search for a word in xml file and delete the entire line using xslt</p>
  
  <p>Example:
  abc.xml</p>
  
  <pre><code>&lt;server&gt;
    &lt;mbean code="org.jboss.varia.property.SystemPropertiesService" 
       name="abc.props:type=Service,name=abcprop"&gt;
    &lt;attribute name="Properties"&gt;
           abc.def.ghi=123
           ghi.klm.nop=123
           qrst.tuv.wxy=123
           zab.cde.fgh=123
           ijk.lmn.opq=remove
           rst.uvw.xyz=123
           abc.tuv.nop=123
           ajc.dzf.goi=123
     &lt;/attribute&gt;
   &lt;/mbean&gt;
  &lt;/server&gt;
  </code></pre>
  
  <p>From the above example I want to search for a word "<strong>remove</strong>" and delete the complete line: <code>ijk.lmn.opq=remove</code></p>
  
  <p>Expected output is:</p>
  
  <pre><code>&lt;server&gt;
        &lt;mbean code="org.jboss.varia.property.SystemPropertiesService" 
           name="abc.props:type=Service,name=abcprop"&gt;
        &lt;attribute name="Properties"&gt;
               abc.def.ghi=123
               ghi.klm.nop=123
               qrst.tuv.wxy=123
               zab.cde.fgh=123
               rst.uvw.xyz=123
               abc.tuv.nop=123
               ajc.dzf.goi=123
         &lt;/attribute&gt;
       &lt;/mbean&gt;
      &lt;/server&gt;
  </code></pre>
  
  <p>Update:</p>
  
  <p>I tried the following code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt;
      &lt;xsl:strip-space elements="*"/&gt;
      &lt;xsl:template match="node()|@*"&gt;
          &lt;xsl:copy&gt;
              &lt;xsl:apply-templates select="node()|@*"/&gt;
          &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
      &lt;xsl:template match="*[(@* != 'DELETE')]"/&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Some how its not working, its deleting every thing in an xml file and showing an empty file.</p>