Filter XML based on attribute value using xslt
===

I have searched here and I'm not able to find how to filter an xml based on their attribute. I have this xml:
<pre>
<code>

   

     &lt;?xml version="1.0" encoding="utf-8"?&gt;
        &lt;document&gt;
        	&lt;document_head&gt;
        		&lt;title&gt;This is the title&lt;/title&gt;
        		&lt;version&gt;This is the title&lt;/version&gt;
        	&lt;/document_head&gt;
        	&lt;document_body&gt;
        		&lt;paragraph id="AXD"&gt;
        			&lt;text&gt;
        				This is a text that should be in the result
        			&lt;/text&gt;
        			&lt;properties&gt;
        				&lt;size&gt;13px&lt;/size&gt;
        				&lt;color&gt;#000000&lt;/color&gt;
        			&lt;/properties&gt;
        			&lt;author&gt;Current user&lt;/author&gt;
        		&lt;/paragraph&gt;
        		&lt;paragraph id="SFI"&gt;
        			&lt;properties&gt;
        				&lt;text&gt;
        					This is some other text that should not be in there
        				&lt;/text&gt;
        			&lt;/properties&gt;
        		&lt;/paragraph&gt;
        		&lt;paragraph id="SFA"&gt;
        			&lt;author&gt;Some random guy&lt;/author&gt;
        		&lt;/paragraph&gt;		
        		&lt;paragraph id="ARG"&gt;
        			This doesn't mean anything.
        		&lt;/paragraph&gt;
        		&lt;paragraph id="RRR"&gt;
        			This does, hence should be in there.
        		&lt;/paragraph&gt;
        	&lt;/document_body&gt;
        &lt;/document&gt;

</code>
</pre>

I expect this result:
<pre>
<code>

    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;document&gt;
    	&lt;document_head&gt;
    		&lt;title&gt;This is the title&lt;/title&gt;
    		&lt;version&gt;This is the title&lt;/version&gt;
    	&lt;/document_head&gt;
    	&lt;document_body&gt;
    		&lt;paragraph id="AXD"&gt;
    			&lt;text&gt;
    				This is a text that should be in the result
    			&lt;/text&gt;
    			&lt;properties&gt;
    				&lt;size&gt;13px&lt;/size&gt;
    				&lt;color&gt;#000000&lt;/color&gt;
    			&lt;/properties&gt;
    			&lt;author&gt;Current user&lt;/author&gt;
    		&lt;/paragraph&gt;
    		&lt;paragraph id="RRR"&gt;
    			This does, hence should be in there.
    		&lt;/paragraph&gt;		
    	&lt;/document_body&gt;
    &lt;/document&gt;

</code>
</pre>

Currently, I have this XSLT:
<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 method="xml" indent="yes"/&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="document_body/paragraph[not(@id='AXD')][not(@id='RRR')]" /&gt;
    &lt;/xsl:stylesheet&gt;

</code>
</pre>

Which produces this XML:
<pre>
<code>

   

     &lt;?xml version="1.0" encoding="UTF-8"?&gt;
        &lt;document&gt;
        	&lt;document_head&gt;
        		&lt;title&gt;This is the title&lt;/title&gt;
        		&lt;version&gt;This is the title&lt;/version&gt;
        	&lt;/document_head&gt;
        	&lt;document_body&gt;
        		&lt;paragraph id="AXD"&gt;
        			&lt;text&gt;
        				This is a text that should be in the result
        			&lt;/text&gt;
        			&lt;properties&gt;
        				&lt;size&gt;13px&lt;/size&gt;
        				&lt;color&gt;#000000&lt;/color&gt;
        			&lt;/properties&gt;
        			&lt;author&gt;Current user&lt;/author&gt;
        		&lt;/paragraph&gt;		
        	&lt;/document_body&gt;
        &lt;/document&gt;

</code>
</pre>

Do you know what I am missing?

Thanks.






