KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
KnowledgeAgent kagent = this.createKAgent( kbase, false, true );
List<String> list = new ArrayList<String>();
kagent.setSystemEventListener( new PrintStreamSystemEventListener( System.out ) );
//Agent: take care of them!
this.applyChangeSet( kagent, ResourceFactory.newByteArrayResource( xml.getBytes() ) );
StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );