if (flatNode instanceof StructuredDocumentRegionProxy) {
return flatNode.getText();
}
ITextRegion region = StructuredDocumentRegionUtil.getFirstRegion(flatNode);
if (region != null) {
String regionType = region.getType();
if (regionType == DOMRegionContext.XML_ENTITY_REFERENCE || regionType == DOMRegionContext.XML_CHAR_REFERENCE) {
String name = StructuredDocumentRegionUtil.getEntityRefName(flatNode, region);
if (name != null) {
DocumentImpl document = (DocumentImpl) getOwnerDocument();
if (document != null) {