}
private final Sequence processText(MemTreeBuilder builder, Sequence nodes, int width,
FunctionReference callback, FunctionReference resultCallback, Sequence extraArgs) throws XPathException {
final StringBuilder str = new StringBuilder();
NodeValue node;
List<Match.Offset> offsets = null;
NodeProxy firstProxy = null;
// First step: scan the passed node sequence and collect the string values of all nodes.
// Translate the relative offsets into absolute offsets.
for (final SequenceIterator i = nodes.iterate(); i.hasNext(); ) {
node = (NodeValue) i.nextItem();
if (node.getImplementationType() == NodeValue.IN_MEMORY_NODE)
{throw new XPathException(this, "Function kwic-display" +
" can not be invoked on constructed nodes");}
NodeProxy proxy = (NodeProxy) node;
// remember the first node, we need it later
if (firstProxy == null)