public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
assert (_toReplace == null);
final XQEventDecoder decoder = new XQEventDecoder(in);
final Sequence<Item> decoded;
try {
decoded = decoder.decode();
} catch (IOException ioe) {
throw new XQRTException("decode failed", ioe);
} catch (XQueryException xqe) {
throw new XQRTException(xqe);
} catch (Throwable e) {