StringBuilder (PsiElement element, StringBuilder builder) { if (element == null) { return builder; } if (element instanceof PsiWhiteSpace) { return builder.append(' '); } final PsiElement[] children = element.getChildren(); if (children.length != 0) { for (PsiElement child : children) { getPresentableText(child, builder); } } else { builder.append(element.getText()); } return builder; }