The JDK class Properties provides the API method for converting the contents of an XML file to Properties object . One can also do the same by first reading the XML file using DOM parser and then writing it to properties file.

The program to convert properties to XML is: