Download and Dependecies

First things first, you'll need to get the XML Factory jar. Stop by XML Factory to grab that.

Once you have that, you'll need the Apache Commons Lang jar, version 2.4 is recommended. However, feel free to try with other versions and let me know if you have any issues.

Java Class to Serialize

Once I have my jars in line, I'll want to find my bean to serialize. I'll pick my aptly named Java bean called "MyBean".

Xml Convertor

You'll then want to add a convertor class, to allow your class to be xml-ized. In my convertor class, I made it an enumerated type to implement a singleton, which is recommended for a standalone convertor class. I can then use the XmlFactory method to generate XML based on my bean.

And that's all there is to it. If we run the convertor, we get the following output....

So go give it a try. Let me know of any suggestions or ideas you have for improvement.