Here's my XML...
< xml version="1.0" encoding="UTF-8" >
<Requested_Stuff>
<IMS_REF_CODE_UPDATE environment="PROD">
<CorpId>prod stuff</CorpId>
<UpdateDate>07/21/2003 18:23:20</UpdateDate>
</IMS_REF_CODE_UPDATE>
<IMS_REF_CODE_UPDATE environment="QA">
<CorpId>qa stuff</CorpId>
<UpdateDate>07/21/2003 18:00:00</UpdateDate>
</IMS_REF_CODE_UPDATE>
<IMS_REF_CODE_UPDATE>
<CorpId>regular stuff</CorpId>
<UpdateDate>07/21/2003 18:23:20</UpdateDate>
</IMS_REF_CODE_UPDATE>
<IMS_REF_CODE_UPDATE environment="DEV">
<CorpId>dev stuff</CorpId>
<UpdateDate>07/21/2003 18:23:20</UpdateDate>
</IMS_REF_CODE_UPDATE>
</Requested_Stuff>
Here's my XSLT...
< xml version="1.0" encoding="UTF-8" >
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:variable name="myEnvironment">PROD</xsl:variable>
<xsl:template match="/*">
<Requests>
<xsl:for-each select="child::*">
<xsl:if test="not(@environment) or @environment=$myEnvironment">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates/>
</Requests>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>
Here's my output...
< xml version="1.0" encoding="UTF-8" >
<Requests>
<IMS_REF_CODE_UPDATE environment="PROD">
<CorpId>prod stuff</CorpId>
<UpdateDate>07/21/2003 18:23:20</UpdateDate>
</IMS_REF_CODE_UPDATE>
<IMS_REF_CODE_UPDATE>
<CorpId>regular stuff</CorpId>
<UpdateDate>07/21/2003 18:23:20</UpdateDate>
</IMS_REF_CODE_UPDATE>
</Requests>
I've been tearing the hair out of my head trying to prevent the output of the "environment" attribute.
Can somebody out there help

Cannot exclude attribute from transformation output.
devish
Sorry, but in your XSLT you explicitly allow an element with this attribute to be copied into output:
<xsl:if test="not(@environment) or @environment=$myEnvironment">
oregonasian
xsl:copy-of copies element with all its attributes and content.
If you want more control use xsl:copy instructions and copy manually whatever you want inside it.