public static boolean deleteXmlDocument(String fileName) { File file = new File(fileName); if (!file.exists()) { return true; } if (!file.canWrite()) { return false; } return file.delete(); }