<template match="Ontology" priority="2">
<text disable-output-escaping="yes"><owl:Ontology</text>
<for-each select="declare">
<text> xmlns</text>
<if test="normalize-space(prefix)!=''">
<text>:</text>
</if>
<value-of select="normalize-space(prefix)"/>
<text>="</text>
<value-of select="normalize-space(namespace)"/>
<text>"</text>
</for-each>
<text disable-output-escaping="yes">></text>
&continue;
<text disable-output-escaping="yes"></owl:Ontology></text>
</template>
this is fine
some OWL processors attach significance to the namespaces which are declared on the root rdf:RDF element so it is important to ensure that all of the namespaces which appear in the ontology are actually declared there
but XSLT 1.0 has very very limited namespace node support, afaict limited only to copying (and even that is a grey area), so you have to do something like this in an earlier stage to create the namespace nodes so that they are there to copy