Wrap (final ASTNode child, final Wrap tagBeginWrap, final Wrap attrWrap, final Wrap textWrap) { if (isTextNode(myNode.getElementType())) return textWrap; final IElementType elementType = child.getElementType(); if (isAttributeElementType(elementType)) return attrWrap; if (elementType == XmlTokenType.XML_START_TAG_START) return tagBeginWrap; if (elementType == XmlTokenType.XML_END_TAG_START) { final PsiElement parent = SourceTreeToPsiMap.treeElementToPsi(child.getTreeParent()); if (parent instanceof XmlTag tag) { if (canWrapTagEnd(tag)) { return getTagEndWrapping(tag); } } return null; } if (isTextNode(elementType) || elementType == XmlTokenType.XML_DATA_CHARACTERS) { ASTNode previous = FormatterUtil.getPreviousNonWhitespaceSibling(child); if (previous == null || !isTextNode(previous.getElementType())) { return myXmlFormattingPolicy.allowWrapBeforeText() ? textWrap : null; } return textWrap; } return null; }