try {
Object entry = col.getEntry(id);
if (entry == null) {
return null;
} else if (entry instanceof Document) {
DocumentImpl doc = (DocumentImpl) entry;
// This should probably just pass the document.
if (doc.getDataBytes() == null) {
return new XMLResourceImpl(id, id, this, TextWriter.toString(doc));
} else {
return new XMLResourceImpl(id, id, this, doc.getSymbols(), doc.getDataBytes());
}
} else if (entry instanceof byte[]) {
return new BinaryResourceImpl(id, this, (byte[])entry);
} else {