Set<Namespace> (final XmlFile psiFile) { final NamespaceCollector namespaceCollector = new NamespaceCollector(); final XmlDocument document = psiFile.getDocument(); if (document != null) { document.accept(namespaceCollector); } return namespaceCollector.namespaces; }