GroovyScriptEngine does not expose it's ClassLoader and therefore objects created and serialized using the GSE cannot be read back in.
Class objectClass = new GroovyScriptEngine().getClassByName(path);
Object obj = objectClass.newInstance();
XStream xstream = new XStream();
FileOutputStream out = new FileOutputStream(new File("myobj.xml"));
// input stream defs removed
obj = xstream.fromXML(xmlIn);
... causes com.thoughtworks.xstream.alias.CannotResolveClassException:, even if you set new GroovyClassLoader() as xstream's classloader it still cannot resolve the class.
Exposing the ClassLoader would enable this. Attached is a GSE that allows this.