for (EReference eReference : proxy.eClass().getEAllReferences())
{
// And find the one that holds this proxy.
//
EReference oppositeEReference = eReference.getEOpposite();
if (oppositeEReference != null && oppositeEReference.isChangeable() && proxy.eIsSet(eReference))
{
// Try to resolve the proxy locally.
//
EObject resolvedEObject = xmlResource.getEObject(proxy.eProxyURI().fragment());
if (resolvedEObject != null)