class LocalNamespaceRegistry extends SimpleNamespaceRegistry {

    @Override
    public String register( String prefix,
                            String namespaceUri ) {
        // Just register the namespace locally ...
        String previous = super.register(prefix, namespaceUri);
        // But check whether there is a "previous" from the delegate ...
        if (previous == null && delegate != null) previous = delegate.getPrefixForNamespaceUri(namespaceUri, false);
        return previous;
    }

    public  LocalNamespaceRegistry( NamespaceRegistry delegate );
    public  LocalNamespaceRegistry( NamespaceRegistry delegate,
                                   final String defaultNamespaceUri );

}