@Override
  public <T extends DomElement> T createStableCopy() {
    XmlTag tag = getXmlTag();
    if (tag != null && tag.isPhysical()) {
      DomInvocationHandler existing = myManager.getDomHandler(tag);
      if (!equals(existing)) {
        throw new IllegalStateException(this + " != " + existing);
      }
      SmartPsiElementPointer<XmlTag> pointer =
        SmartPointerManager.getInstance(myManager.getProject()).createSmartPsiElementPointer(tag);
      return myManager.createStableValue(new StableCopyFactory<>(pointer, myType, getClass()));
    }
    return (T)createPathStableCopy();
  }
@Override
  public <T extends DomElement> T createStableCopy()