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

        return "";
    }