protected void writeNamespaces() throws IOException {
        if ( namespacesMap != null ) {
            for ( Iterator<Map.Entry<String, String>> iter = namespacesMap.entrySet().iterator(); iter.hasNext(); ) {
                Map.Entry<String, String> entry = iter.next();
                String prefix = entry.getKey();
                String uri = entry.getValue();
                writeNamespace(prefix, uri);
            }
            namespacesMap = null;
        }
    }
Writes the SAX namepsaces
@throws IOException if the namespaces could not be written
xmppserver/src/main/java/org/jivesoftware/util/XMLWriter.java