private static boolean containsOnlyText(Node n) {
if (!(n instanceof Element)) { return false; }
Element el = (Element) n;
ElKey schemaKey = ElKey.forElement(el);
if (schemaKey.isHtml()) {
HtmlTextEscapingMode mode = HtmlTextEscapingMode.getModeForTag(
schemaKey.localName);
return mode != HtmlTextEscapingMode.PCDATA;
} else {
return false;
}