The Java Architecture for XML Binding API (JAXB) provides a client application the ability to convert XML data into a tree of Java classes. The IDE provides a code template that you can use to generate a code snippet as the basis for this task.
To unmarshall XML elements to Java classes:
try { javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(Object.class.getClass().getPackage().getName()); javax.xml.bind.Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller(); Object.class = unmarshaller.unmarshal(new java.io.File("File path")); //NOI18N } catch (javax.xml.bind.JAXBException ex) { // XXXTODO Handle exception java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N }