@SuppressWarnings("rawtypes")
	@Override
    public Iterator getPrefixes(final String namespaceURI) {
    	if (namespaceURI == null) {
    		throw new IllegalArgumentException("NamespaceContext requires a non-null Namespace URI");
    	}
    	if (JDOMConstants.NS_URI_XML.equals(namespaceURI)) {
    		return Collections.singleton(JDOMConstants.NS_PREFIX_XML).iterator();
    	}
    	if (JDOMConstants.NS_URI_XMLNS.equals(namespaceURI)) {
    		return Collections.singleton(JDOMConstants.NS_PREFIX_XMLNS).iterator();
    	}
    	
        final List<String> ret = new ArrayList<String>();
        for(final Namespace n : namespacearray){
            if(n.getURI().equals(namespaceURI)){
                ret.add(n.getPrefix());
            }
        }

        return Collections.unmodifiableCollection(ret).iterator();
    }