private @Nullable XmlElementArrangementEntry createNewEntry(@NotNull PsiElement element,
                                                              @NotNull ArrangementSettingsToken type,
                                                              @Nullable String name,
                                                              @Nullable String namespace) {
    TextRange range = element.getTextRange();
    if (range.getStartOffset() == 0 && range.getEndOffset() == 0 || !isWithinBounds(range)) {
      return null;
    }
    ArrangementEntry current = getCurrent();
    if (current != null && type == XML_ATTRIBUTE) {
      current = current.getChildren().get(0);
    }
    final XmlElementArrangementEntry entry = new XmlElementArrangementEntry(current, range, type, name, namespace, true);
    if (type == XML_TAG) {
      ASTNode startName = XmlChildRole.START_TAG_NAME_FINDER.findChild(element.getNode());
      assert startName != null;
      ASTNode end = XmlChildRole.START_TAG_END_FINDER.findChild(element.getNode());
      end = end == null ? XmlChildRole.EMPTY_TAG_END_FINDER.findChild(element.getNode()) : end;
      TextRange attributesRange = new UnfairTextRange(startName.getTextRange().getEndOffset(),
                                                end != null ? end.getStartOffset() : range.getEndOffset());
      if (attributesRange.getLength() > 0) {
        entry.addChild(new XmlElementArrangementEntry(entry, attributesRange, XML_ATTRIBUTE, null, null, false));
      }
    }

    if (current == null) {
      myInfo.addEntry(entry);
    }
    else {
      ((DefaultArrangementEntry)current).addChild(entry);
    }
    return entry;
  }
private @Nullable XmlElementArrangementEntry createNewEntry(@NotNull PsiElement element,
                                                              @NotNull ArrangementSettingsToken type,
                                                              @Nullable String name,
                                                              @Nullable String namespace)