import java.io.Serializable;
import java.beans.*;
import java.io.*;
public class Test implements Serializable{
  int prop;
  public Test(){}
  public Test(int prop){this.prop=prop;}
  public int getProp(){return prop;}
  public static void main(String[] args) {
    Test o=new Test(123);
    try {
      XMLEncoder encoder=new XMLEncoder(new BufferedOutputStream(
          new FileOutputStream("test.xml")));
      String[]pName=new String[]{"prop"};
      encoder.setPersistenceDelegate(Test.class,new DefaultPersistenceDelegate(pName));
      encoder.writeObject(o);
      encoder.close();
    }catch (FileNotFoundException ex) {}
  }
}