public String namespaceIdentifier(int namespace) throws IOException
    {
        if (namespaces == null)
            populateNamespaceCache();

        // anything we cannot identify is assumed to be in the main namespace
        if (!namespaces.containsValue(namespace))
            return "";
        for (Map.Entry<String, Integer> entry : namespaces.entrySet())
            if (entry.getValue().equals(namespace))
                return entry.getKey();
        return ""; // never reached...
    }