I think that solve your problem; it's about giving the read-only properties when calling the bean constructor.
Make a String array with your private properties, and setup on the XMLEncoder a DefaultaPersistenceDelegate:
XMLEncoder.setDefaultPersistenceDelegate(YorBean.class,
new DefaultPersistenceDelegate(String[] constructorPropertyNames))