I'm using jaxb to make xml file and store it in my pc, and i want when making another file to store it in addition to the first file in the same xml file that is on my pc, for example this is the first file:
<File>
<thing1>
</thing1>
</file>
And i want the second file to be like that :
<File>
<thing1>
</thing1>
<thin2g>
</thing2>
</file>
And that's the Java code i use for marshaling:
public ConfList(Object obj){
this.obj = obj;
}
public void addToLXML() throws IOException, JAXBException {
File file = new File(fileName);
JAXBContext jaxbContext = JAXBContext.newInstance(Xml.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxbMarshaller.marshal(obj, file);
jaxbMarshaller.marshal(obj, System.out);
}