xstream.useAttributeFor(DefaultRelation.class, "rel");
xstream.useAttributeFor(DefaultRelation.class, "href");
xstream.useAttributeFor(DefaultRelation.class, "type");
for (Class type : typesToEnhance) {
realTypes.put(type, new Enhancer().enhanceResource(type));
xstream.processAnnotations(type);
}
Class enhancedType = new Enhancer().enhanceResource(EnhancedList.class);
realTypes.put(EnhancedList.class, enhancedType);
for (String name : collectionNames) {
xstream.alias(name, enhancedType);
}