Assuming that a complete version of your input file might look like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<Schemas>
<ns1:Schema xmlns:ns1="app1" >
<ns1:complexType Name = "Comp1">
<ns1:EntityType Name = "a1"/>
<ns1:EntityType Name = "b1"/>
</ns1:complexType>
</ns1:Schema>
<ns2:Schema xmlns:ns2="app2">
<ns2:complexType Name = "Comp2">
<ns2:EntityType Name = "a2"/>
<ns2:EntityType Name = "b2"/>
</ns2:complexType>
</ns2:Schema>
</Schemas>
the following XSLT shows how to filter the tags by the URI of the namespaceand the name of the namespace.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.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="ns_uri1" select="'app1'"/>
<xsl:variable name="ns_uri2" select="'app2'"/>
<xsl:variable name="ns_name1" select="'ns1'"/>
<xsl:variable name="ns_name2" select="'ns2'"/>
<xsl:template match="/Schemas">
<apps>
<app1_selected_by_namespace_uri>
<xsl:copy-of select="*[local-name(.) = 'Schema' and namespace-uri(.)=$ns_uri1]"/>
</app1_selected_by_namespace_uri>
<app2_selected_by_namespace_uri>
<xsl:copy-of select="*[local-name(.) = 'Schema' and namespace-uri(.)=$ns_uri2]"/>
</app2_selected_by_namespace_uri>
<app1_selected_by_namespace_name>
<xsl:copy-of select="*[name(.) = concat($ns_name1, ':Schema')]"/>
</app1_selected_by_namespace_name>
<app2_selected_by_namespace_name>
<xsl:copy-of select="*[name(.) = concat($ns_name2, ':Schema')]"/>
</app2_selected_by_namespace_name>
</apps>
</xsl:template>
</xsl:stylesheet>
yielding the following output document
<?xml version="1.0" encoding="UTF-8"?>
<apps>
<app1_selected_by_namespace_uri>
<ns1:Schema xmlns:ns1="app1">
<ns1:complexType Name="Comp1">
<ns1:EntityType Name="a1"/>
<ns1:EntityType Name="b1"/>
</ns1:complexType>
</ns1:Schema>
</app1_selected_by_namespace_uri>
<app2_selected_by_namespace_uri>
<ns2:Schema xmlns:ns2="app2">
<ns2:complexType Name="Comp2">
<ns2:EntityType Name="a2"/>
<ns2:EntityType Name="b2"/>
</ns2:complexType>
</ns2:Schema>
</app2_selected_by_namespace_uri>
<app1_selected_by_namespace_name>
<ns1:Schema xmlns:ns1="app1">
<ns1:complexType Name="Comp1">
<ns1:EntityType Name="a1"/>
<ns1:EntityType Name="b1"/>
</ns1:complexType>
</ns1:Schema>
</app1_selected_by_namespace_name>
<app2_selected_by_namespace_name>
<ns2:Schema xmlns:ns2="app2">
<ns2:complexType Name="Comp2">
<ns2:EntityType Name="a2"/>
<ns2:EntityType Name="b2"/>
</ns2:complexType>
</ns2:Schema>
</app2_selected_by_namespace_name>
</apps>
In both cases the names are not hardcoded but given by parameters. I guess that one of the versions will suit your needs. You will find the XPath expression in the select attributes of the copy-of tags.
<Schema>tag? In this case you can you can simply filtering by this attribute, e.g."//Schema[@Namespace="XXX"]/...". Or is it b) a true namespace declaration to your<Schema>tag, in which case the example would be missing the namespace prefixes.