Anyway, I used JDOM-2 for manipulating XML data, Below is my implemented code portion
/* Generating a XML file from Proto the message. */
public void proto2Xml(Message message) {
SAXBuilder builder = new SAXBuilder();
Document document;
XMLOutputter outputter;
try {
document = builder.build(new ByteArrayInputStream(XmlFormat.printToString(message).toString().getBytes()));
outputter = new XMLOutputter();
outputter.setFormat(Format.getPrettyFormat());
System.out.println("++++++++PROTO2XML++++++++++++++++++++");
outputter.output(document, System.out); // XML Console out.
System.out.println("++++++++++++++++++++++++++++++++++++++");
outputter.output(document, new FileWriter(xmlFilePath));
} catch (JDOMException e) {
System.out.println("JDOMException : " + e.getMessage());
} catch (IOException e) {
System.out.println("IOException : " + e.getMessage());
}
} // End of proto2Xml.