EReference targetReference = ReferencesPackage.Literals.ELEMENT_REFERENCE__TARGET;
IdentifierReference mainIdReference = ReferencesFactory.eINSTANCE.createIdentifierReference();
mainIdReference.eSet(
targetReference, proxy);
String id = ((InternalEObject)proxy).eProxyURI().fragment();
id = id.substring("EMFTEXT_INTERNAL_URI_FRAGMENT_".length());
id = id.substring(id.indexOf("_") + 1);