Deserializing a class from an xml previously generated with xStream StaxDriver() cause that the file remain opened until i close the entire application.
A snippet of code that cause the issue :
File file = new File("C:\settings.xml");
XStream xstream = new XStream(new StaxDriver());
Settings s = (Settings) xstream.fromXML(file);
After calling fromXml() the file settings.xml remain locked(i can't remove the file) until the application ends.
A possible ugly workaround seem calling System.gc() after the fromXML() method ...
See this related question on StackOverflow : http://stackoverflow.com/questions/8173124/java-xstream-closing-connection-to-file