ASTNode (String displayText, PsiElement text) { if(!toCode(displayText)) return super.encodeXmlTextContents(displayText, text); final FileElement dummyParent = DummyHolderFactory.createHolder(text.getManager(), null, SharedImplUtil.findCharTableByTree(text.getNode())).getTreeElement(); int sectionStartOffset = 0; int offset = 0; while (offset < displayText.length()) { if (toCode(displayText.charAt(offset))) { final String plainSection = displayText.substring(sectionStartOffset, offset); if (!plainSection.isEmpty()) { dummyParent.rawAddChildren((TreeElement)super.encodeXmlTextContents(plainSection, text)); } dummyParent.rawAddChildren(createCharEntity(displayText.charAt(offset), dummyParent.getCharTable())); sectionStartOffset = offset + 1; } offset++; } final String plainSection = displayText.substring(sectionStartOffset, offset); if (!plainSection.isEmpty()) { dummyParent.rawAddChildren((TreeElement)super.encodeXmlTextContents(plainSection, text)); } dummyParent.acceptTree(new GeneratedMarkerVisitor()); return dummyParent.getFirstChildNode(); }