Object cached = provider.getCachedResult();
if ((cached != null) && expectedType.isInstance(cached))
return cached;
TreeBuilder builder = new TreeBuilder(manager, expectedType);
InputStream stream = provider.openInputStream();
try
{
InputSource source = new InputSource(stream);
source.setSystemId(sourceName);