ASTNode (String displayText, PsiElement text) { final ASTNode firstChild = text.getNode().getFirstChildNode(); boolean textAlreadyHasCDATA = firstChild != null && firstChild.getElementType() == XmlElementType.XML_CDATA; if ((textAlreadyHasCDATA || XmlUtil.toCode(displayText)) && !displayText.isEmpty()) { final FileElement dummyParent = createCDATAElement(text.getManager(), SharedImplUtil.findCharTableByTree(text.getNode()), displayText); return dummyParent.getFirstChildNode(); } else { return super.encodeXmlTextContents(displayText, text); } }