InputSource (PsiFile descriptorFile) { final InputSource inputSource = new InputSource(new StringReader(descriptorFile.getText())); final VirtualFile file = descriptorFile.getVirtualFile(); if (file != null) { inputSource.setSystemId(VfsUtilCore.fixIDEAUrl(file.getUrl())); } return inputSource; }