class JaxbLoader {

    public static MMOs loadXml(final File xmlFile)
            throws JAXBException, SAXException, ParserConfigurationException, FileNotFoundException {
        final JAXBContext jaxbContext = JAXBContext.newInstance(MMOs.class);
        final Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();

        // avoid getting the DTD (was mainly for when demoing without a network, but should maybe be kept?)
        final SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setFeature("http://apache.org/xml/features/validation/schema", false);
        spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
        final XMLReader xmlReader = spf.newSAXParser().getXMLReader();
        final InputSource inputSource = new InputSource(new FileReader(xmlFile));
        final SAXSource source = new SAXSource(xmlReader, inputSource);

        return (MMOs) jaxbUnmarshaller.unmarshal(source);
    }

}