boolean () { final PsiFile psiFile = getPsiFile(); if (psiFile == null || !psiFile.isValid()) { return false; } if (psiFile instanceof XmlFile) { final XmlDocument document = ((XmlFile)psiFile).getDocument(); return document != null && document.getRootTag() != null; } return true; }