If we would like to generate a xml file like this:
How to do it?
We can make good use of XStream to help us to implement this requirement easily.
Add XStream dependency to your pom.xml
Step1. Create a simple class to correspond to xml tags.
Step2. Serialize object to XML via XStream API