@Override
  public void visitXmlTag(@NotNull XmlTag tag) {
    try {
      setLocation(tag);

      final Map<String,String> map = tag.getLocalNamespaceDeclarations();
      final String[] prefixes = ArrayUtilRt.toStringArray(map.keySet());
      for (String prefix : prefixes) {
        myHandler.startPrefixMapping(prefix, map.get(prefix));
      }

      final Attributes2Impl atts = new Attributes2Impl();
      final XmlAttribute[] xmlAttributes = tag.getAttributes();
      for (XmlAttribute attribute : xmlAttributes) {
        final String s = attribute.getName();
        if (!"xmlns".equals(s) && !s.startsWith("xmlns:")) {
          final String uri = attribute.getNamespace();
          atts.addAttribute(s.contains(":") ? uri : "", attribute.getLocalName(), s, "PCDATA", attribute.getValue());
        }
      }

      final String namespace = tag.getNamespace();
      final String localName = tag.getLocalName();
      final String name = tag.getName();
      myHandler.startElement(namespace, localName, name, atts);

      PsiElement child = tag.getFirstChild();
      while (child != null) {
        child.accept(this);
        child = child.getNextSibling();
      }

      myHandler.endElement(namespace, localName, name);

      for (int i = prefixes.length - 1; i >= 0; i--) {
        String prefix = prefixes[i];
        myHandler.endPrefixMapping(prefix);
      }
    } catch (SAXException e) {
      throw new ParseError(e);
    }
  }
@Override
  public void visitXmlTag(@NotNull XmlTag tag)