Node (FormatStack fstack, NamespaceStack nstack, org.w3c.dom.Document basedoc, Content content) { switch (content.getCType()) { case CDATA: return printCDATA(basedoc, (CDATA)content); case Comment: return printComment(basedoc, (Comment)content); case Element: return printElement(fstack, nstack, basedoc, (Element)content); case EntityRef: return printEntityRef(basedoc, (EntityRef)content); case Text: return printText(basedoc, (Text)content); case DocType: return null; default: throw new IllegalStateException("Unexpected Content " + content.getCType()); } }