PR: 19301 Use xalan extensions to replace strings and avoid a stack overflow when doing deep recursions.