@Override
    public String getPrefix(final String namespaceURI) {
    	if (namespaceURI == null) {
    		throw new IllegalArgumentException("NamespaceContext requires a non-null Namespace URI");
    	}
    	if (JDOMConstants.NS_URI_XML.equals(namespaceURI)) {
    		return JDOMConstants.NS_PREFIX_XML;
    	}
    	if (JDOMConstants.NS_URI_XMLNS.equals(namespaceURI)) {
    		return JDOMConstants.NS_PREFIX_XMLNS;
    	}
    	
        for(final Namespace n : namespacearray){
            if(n.getURI().equals(namespaceURI)){
                return n.getPrefix();
            }
        }

        return null;
    }