@Override
      public void visitXmlAttribute(@NotNull XmlAttribute xmlAttribute) {
        boolean replaced = false;

        if (xmlAttribute.isNamespaceDeclaration()) {
          replaced = true;
          final String value = xmlAttribute.getValue();
          result.append(xmlAttribute.getText()).append(" ");

          if (!scannedToFileName.containsKey(value)) {
            final XmlNSDescriptor nsDescriptor = xmlAttribute.getParent().getNSDescriptor(value, true);

            if (nsDescriptor != null) {
              processAndSaveAllSchemas(Objects.requireNonNull(nsDescriptor.getDescriptorFile()), scannedToFileName, schemaReferenceProcessor);
            }
          }
        }
        else if ("schemaLocation".equals(xmlAttribute.getName())) {
          PsiReference[] references = Objects.requireNonNull(xmlAttribute.getValueElement()).getReferences();
          PsiReference reference = ArrayUtil.getLastElement(references);
          if (reference != null) {
            PsiElement psiElement = reference.resolve();

            if (psiElement instanceof XmlFile) {
              final String s = processAndSaveAllSchemas(((XmlFile)psiElement), scannedToFileName, schemaReferenceProcessor);
              result.append(xmlAttribute.getName()).append("='").append(s).append('\'');
              replaced = true;
            }
          }
        }
        if (!replaced) result.append(xmlAttribute.getText());
      }
@Override
      public void visitXmlAttribute(@NotNull XmlAttribute xmlAttribute)