AntDomProject (PsiFile psiFile) { if (psiFile instanceof XmlFile) { final DomManager domManager = DomManager.getDomManager(psiFile.getProject()); DomFileElement<AntDomProject> fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class); if (fileElement == null) { ForcedAntFileAttribute.forceAntFile(psiFile.getVirtualFile(), true); fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class); } return fileElement != null? fileElement.getRootElement() : null; } return null; }