Smooks smooks = new Smooks(getClass().getResourceAsStream("config-01.xml"));
StringResult result = new StringResult();
JavaResult beans = new JavaResult();
final List<String> orderItems = new ArrayList<String>();
smooks.getApplicationContext().addBeanContextLifecycleObserver(new BeanContextLifecycleObserver() {
public void onBeanLifecycleEvent(BeanContextLifecycleEvent event) {
if(event.getLifecycle() == BeanLifecycle.REMOVE && event.getBeanId().getName().equals("orderItem")) {
orderItems.add((String) event.getBean());
}
}