@Override public void visitXmlTag(@NotNull XmlTag tag) {
    final XmlTag another = myMatchingVisitor.getElement(XmlTag.class);
    if (another == null) return;
    final CompiledPattern pattern = myMatchingVisitor.getMatchContext().getPattern();
    final XmlToken name = getTagNameToken(tag);
    final boolean isTypedVar = pattern.isTypedVar(name);

    if (!myMatchingVisitor.setResult((isTypedVar || myMatchingVisitor.matchText(tag.getName(), another.getName())) &&
                                     myMatchingVisitor.matchInAnyOrder(tag.getAttributes(), another.getAttributes()))) return;

    final XmlTagChild[] children1 = tag.getValue().getChildren();
    if (children1.length != 0) {
      if (children1.length == 1 && pattern.isTypedVar(children1[0])) {
        final NodeIterator patternNodes = SsrFilteringNodeIterator.create(tag.getValue().getChildren());
        if (patternNodes.current() != null) {
          final NodeIterator matchNodes = SsrFilteringNodeIterator.create(another.getValue().getChildren());
          if (!myMatchingVisitor.setResult(myMatchingVisitor.matchSequentially(patternNodes, matchNodes))) return;
        }
      }
      else if (children1.length != 1 || !XmlMatchUtil.isWhiteSpace(children1[0])) {
        final ListNodeIterator patternNodes = new ListNodeIterator(XmlMatchUtil.getElementsToMatch(children1));
        final XmlTagChild[] children2 = another.getValue().getChildren();
        final ListNodeIterator matchNodes = new ListNodeIterator(XmlMatchUtil.getElementsToMatch(children2));
        if (!myMatchingVisitor.setResult(myMatchingVisitor.matchSequentially(patternNodes, matchNodes))) return;
      }
    }
    if (isTypedVar) {
      final SubstitutionHandler handler = (SubstitutionHandler)pattern.getHandler(name);
      myMatchingVisitor.setResult(handler.handle(getTagNameToken(another), myMatchingVisitor.getMatchContext()));
    }
  }
@Override public void visitXmlTag(@NotNull XmlTag tag)