1. Why will we need to convert java to XML ? storage ? No, we could directly save data into relational database.
XML is easily portable and can be used interoperability between systems. sometimes it can be used as common protocol to 2 different system communicate.
I know it could convert data between java and XML. But in real world, what is usage for this API ?
Well say your application receives inbound XML from various systems and you need to do some calculations and store certain values to DB. you should probably use JAXB to convert XML to java objects and retrieve the objects to perform operations and store it in DB.