@Override
  public Spacing getSpacing(Block child1, @NotNull Block child2) {
    if (!(child1 instanceof AbstractBlock) || !(child2 instanceof AbstractBlock)) {
      return null;
    }

    final IElementType elementType = myNode.getElementType();
    final ASTNode node1 = ((AbstractBlock)child1).getNode();
    final IElementType type1 = node1.getElementType();
    final ASTNode node2 = ((AbstractBlock)child2).getNode();
    final IElementType type2 = node2.getElementType();

    if ((isXmlTag(node2) || type2 == XmlTokenType.XML_END_TAG_START || isTextNode(type2)) && myXmlFormattingPolicy
      .getShouldKeepWhiteSpaces()) {
      return Spacing.getReadOnlySpacing();
    }

    if (isTextNode(elementType)) {
      return getSpacesInsideText(type1, type2);

    }
    else if (isAttributeElementType(elementType)) {
      return getSpacesInsideAttribute(type1, type2);
    }

    if (type1 == XmlElementType.XML_PROLOG) {
      return createDefaultSpace(true, false);
    }

    if (elementType == XmlElementType.XML_DOCTYPE) {
      return createDefaultSpace(true, false);
    }

    if (type1 == XmlElementType.XML_COMMENT) {
      return createDefaultSpace(true, false);
    }

    return createDefaultSpace(false, false);
  }
@Override
  public Spacing getSpacing(Block child1, @NotNull Block child2)