There are a few ways to achieve this
1. You can make use of the JAXB (Java API for XML
Binding) url is given below
java.sun.com/xml/jaxb/users-guide/jaxb-java.html
These set of API's allow the user to map an xml file
to a set of concrete java Classes allowing Marshelling
and Un Marshelling from and to XML files to java
classes.
2. Write your own class that serializes and de
serializes.
First serialize the object and write into the file
system by using the ObjectInput and ObjectInput stream
classes found in java.io packages.
Then write your own class that makes use of a class
that takes in an object and writes an XML file back
into the HDD or stream.