public Set<Namespace> getAllNamespaces() {
        if (namespaceGroup == null) {
            return emptySet();
        }
        return new HashSet<Namespace>(namespaceGroup.getAllNamespaces());
    }
public Set < Namespace > getAllNamespaces ( ) { if ( namespaceGroup == null ) { return emptySet ( ) ; } return new HashSet < Namespace > ( namespaceGroup . getAllNamespaces ( ) ) ; }
Returns the set of all namespaces contained within the document.

@return Set of namespaces, which may be empty