public static boolean saveObject(Object object, String name, boolean temp) {
        FileOutputStream outputFile;
        JAXBContext context;
        Marshaller marshaller;
        File file;
        String s = null;
        if (Tournament.class.isInstance(object)) {
            if (!temp) {
                file = new File(DIR + TOURNAMENT_DIR + SEPARATOR + name + ".xml");
                File tempFile = new File(DIR + TEMP_DIR + SEPARATOR + "tmp" + name + ".xml");
                if (tempFile.exists())
                    tempFile.delete();
            } else {
                file = new File(DIR + TEMP_DIR + SEPARATOR + "tmp" + name + ".xml");
            }
            Tournament objectSerialized = (Tournament) object;
            s = objectSerialized.getTournamentStateString();
            objectSerialized.setTournamentState("STOPPED");

        } else {
            if (TournamentConfiguration.class.isInstance(object)) {
                file = new File(DIR + TOURNAMENT_CONFIGURATION_DIR + SEPARATOR + name + ".xml");
                TournamentConfiguration objectSerialized = (TournamentConfiguration) object;
                objectSerialized.setName(name);
            } else {
                if (BlindStruct.class.isInstance(object)) {
                    file = new File(DIR + BLINDS_DIR + SEPARATOR + name + ".xml");
                    BlindStruct objectSerialized = (BlindStruct) object;
                    objectSerialized.setName(name);
                } else {
                    if (Announcement.class.isInstance(object)) {
                        file = new File(DIR + ANNOUNCEMENT_DIR + SEPARATOR + name + ".xml");                        
                    } else {
                        file = new File(DIR + PRIZES_DIR + SEPARATOR + name + ".xml");
                        PrizeStruct objectSerialized = (PrizeStruct) object;
                        objectSerialized.setName(name);
                    }
                }
            }
        }
        try {
            outputFile = new FileOutputStream(file.getAbsolutePath());
            context = JAXBContext.newInstance(object.getClass());
            marshaller = context.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
            marshaller.marshal(object, outputFile);
        } catch (FileNotFoundException | NullPointerException | JAXBException ex) {
            System.out.println("error Serializando: "+ ex.getCause().toString());
        }
        if (Tournament.class.isInstance(object)) {
            Tournament objectSerialized = (Tournament) object;
            objectSerialized.setTournamentState(s);
        }
        return true;
    }