public void writeToFile(Dictionary dictionary) {
        //file wegschrijven naar xml
        try {
            JAXBContext context = JAXBContext.newInstance(Dictionary.class);
            Marshaller m = context.createMarshaller();
            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            m.marshal(dictionary, new File(PathUtils.getDictionaryPath() + PathUtils.DICTIONARY_PREFIX + dictionary.getLanguage() + FILE_TYPE));
        } catch (JAXBException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }