We will show here a method to serialize an instance of a class to an XML file. We will use the java.beans package and contained there classes XMLEncoder and XMLDecoder.
First we need a class to serialize:
public class SerializeMe {
public Integer data;
public void setData(Integer data) {
[...]