find out if my xml file contains a certain namespace (where no elements are given that name).
It is difficult to understand what exactly you mean by that. If you want to find out if the input XML contains a namespace declaration using a given namespace URI, regardless of whether this declaration is used to place any of the XML's nodes in said namespace or not, you can use a test in the form of:
<xsl:if test="//namespace::*[.='your-namespace-URI']">
Example:
XML
<root xmlns:ns1="http://example.com/a">
<item>Alpha</item>
<item>Bravo</item>
<item>Charlie</item>
</root>
XSLT 1.0
<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:template match="/">
<result>
<xsl:if test="//namespace::*[.='http://example.com/a']">YES</xsl:if>
</result>
</xsl:template>
</xsl:stylesheet>
Result
<?xml version="1.0" encoding="UTF-8"?>
<result>YES</result>
The result here is positive, even though the XML has no nodes that are actually in the "http://example.com/a" namespace.