XtextResourceSet resourceSet = getInstanceOf(XtextResourceSet.class);
resourceSet.setClasspathURIContext(getClass());
XtextResource resource = (XtextResource) getInstanceOf(IResourceFactory.class).createResource(uri);
resourceSet.getResources().add(resource);
try {
resource.load(input, null);
} catch (IOException e) {
throw new RuntimeException(e);
}
if (resource instanceof LazyLinkingResource) {
((LazyLinkingResource) resource).resolveLazyCrossReferences(NullImpl);