…when even your JavaScript code starts looking like this:
function applyTextProcessors(xmlFragment, textProcessors) {
return textProcessors.length == 0 ?
xmlFragment :
applyTextProcessors(
xml.mapTextNodes(
xmlFragment, function(textNode) {
return text.mapMatch(textNode.toString(),
textProcessors[0].regexp,
textProcessors[0].action);
}),
textProcessors.slice(1));
}