private static @Nullable DomInvocationHandler createRootHandler(XmlTag xmlTag) {
    PsiFile file = xmlTag.getContainingFile();
    DomFileElementImpl<?> element = file instanceof XmlFile ? DomManagerImpl.getDomManager(file.getProject()).getFileElement((XmlFile)file) : null;
    if (element != null) {
      final DomRootInvocationHandler handler = element.getRootHandler();
      if (handler.getXmlTag() == xmlTag) {
        return handler;
      }
    }
    return null;
  }
private static @Nullable DomInvocationHandler createRootHandler(XmlTag xmlTag)