This article is supposed to start you off for writing applications which read and write XML data in Java. In 80% of cases when somebody needs to start such and application from scratch, he doesn’t need too much theory about XML, instead he wants to have a piece of code that simply shows how to [...]
Serialization to XML
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) {
[...]