CollectedInfo (final XmlFile psiFile) { final NamespaceCollector namespaceCollector = new NamespaceCollector(); final XmlDocument document = psiFile.getDocument(); if (document != null) { document.accept(namespaceCollector); } return new CollectedInfo(namespaceCollector.namespaces, namespaceCollector.elements, namespaceCollector.attributes); }