MavenProject (@NotNull DomElement domElement) { XmlElement xmlElement = domElement.getXmlElement(); if (xmlElement == null) return null; PsiFile psiFile = xmlElement.getContainingFile(); if (psiFile == null) return null; VirtualFile file = psiFile.getVirtualFile(); if (file == null) return null; return MavenProjectsManager.getInstance(psiFile.getProject()).findProject(file); }