Serialize POJO to XML

Today my colleague, Chandana was trying to convert POJO to an XML file. In our company we are working with dom4j library, but unfortunately it does not provide the capabilities to convert a Java object on the fly to an XML.

Off course Chandana could always manually create new Document, root element, sub elements and attributes and that would work fine. But this still does not solves Chandana’s problem where she needed to generate XML on the fly.

After some time doing a research on the Internet she came across this very nice library call XStream. Its a very nice library which allows to serialize objects to XML and back again. It doesn’t require mapping nor modifications to the object itself. They also have a short tutorial which converts a POJO to an XML in few simple steps. Very nice and usefuL

Pebble 2.3 Application Blog

Finally i got my own blog…. wooo hooo! As a first entry in my blog i would like to express a HUGE gratitude to Simon Brown for creating this amazing application. It is j2ee application, and it does not need a database. Blog content is stored as XML files on disk and served up dynamically. As a Java fan my self i find it truly amazing and neat. So …. THANK YOU Simon!!