XML has set ubiquitary standards for representing data. There are several XML technologies that can be used to serialize Java objects to XML. Some of the most commonly technologies used by Java developers include the Simple API for XML (SAX) and the Document Object Model (DOM) APIs. For a smooth control over parsing and serialization SAX, or Stax offers better performance. However, the programmers prefer to use technologies that can accomplish immediate tasks. However, we would provide you two simple and quick howto's for serialization of Java Objects to XML and deserialize back to XML.
Java API for XML Binding (JAXB) provides a simple and quick Java-XML mapping or serialization. With JAXB you can performs a number of tasks that include binding of class data from XML schema, and serializing object data to and from XML. We would show you how to do simple Java-XML serialization with JAXB.
Again, Java has the inherent benefit of Library that enables almost everything. XStream is simple and easy to use library for serializing Java-Objects to XML and read them back. It converts the existing Java objects clean XML and restores them again without any modifications. XStream 2.1.0 is currentl.y available for the users. Here's how to serialize Java Objects to XML and deserialize back from XML
Full article (1160 words) »