You never delete anything in XSLT. You either copy it from the input to the output, or you don't. You can think of the things that aren't copied as being deleted, but in your code it's the other way around: data is deleted if you fail to copy it.
Generally for this kind of stylesheet you write a template rule that copies everything:
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
and then add extra rules for things you don't want to copy:
<xsl:template match="*[*/UML:Package/@xml.idref]"/>
<xsl:template match="UML:Package[not(@xml.idref)]">
<xsl:apply-templates select="UML:Namespace.ownedElement"/>
</xsl:template>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference