Storing properties into an XML file in JDK 1.5

StoreProps.java:

import java.util.*;
import java.io.*;
 
public class StoreProps
{
   public static void main(String []args) {
      Properties props = new Properties();
       
      props.put("path", "c:\program files\app");
      props.put("socketlock", "4550");
       
      System.out.println(props);
       
      try {
         // the second parameter is a single comment you can provide
         props.storeToXML(new FileOutputStream(new File("config.xml")), "Configuration for application");
      }
      catch(IOException e) { 
         e.printStackTrace();
      }
   }
}

Generates the file config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Configuration for application</comment>
<entry key="socketlock">4550</entry>
<entry key="path">c:program filesapp</entry>
</properties>