JAXB Marshalling Example: Converting Object into XML
By the help of Marshaller interface, we can marshal(write) the object into xml document. In the previous page, we have seen the simple example of converting object into xml.
In this example, we are going to convert the object into xml having primitives, strings and collection objects.
Let's see the steps to convert java object into XML document.
The generated xml file will look like this: