switch(node.getNodeKind()) {
case Type.DOCUMENT:
case Type.ELEMENT:
SequenceIterator iter = node.iterateAxis(Axis.CHILD);
XPathContextMajor c2 = context.newContext();
TailCall tc = ApplyTemplates.applyTemplates(
iter, context.getCurrentMode(), parameters, tunnelParams, c2, sourceLocator);
while (tc != null) {
tc = tc.processLeavingTail();
}
return;
case Type.TEXT:
// NOTE: I tried changing this to use the text node's copy() method, but
// performance was worse