List plays = new ArrayList();
Digester digester = new Digester();
Rules rules = digester.getRules();
rules.add( "plays/play", new ObjectCreateRule("com.discursive.jccook.xml.bean.Play"));
rules.add( "plays/play", new SetNextRule("add", "java.lang.Object") );
rules.add( "plays/play", new SetPropertiesRule() );
rules.add( "plays/play/name", new BeanPropertySetterRule("name") );
rules.add( "plays/play/summary", new BeanPropertySetterRule("summary") );
rules.add( "plays/play/author", new BeanPropertySetterRule("author") );
rules.add( "plays/play/characters/character", new ObjectCreateRule("com.discursive.jccook.xml.bean.Character"));
rules.add( "plays/play/characters/character", new SetNextRule("addCharacter", "com.discursive.jccook.xml.bean.Character"));
rules.add( "plays/play/characters/character", new SetPropertiesRule() );
rules.add( "plays/play/characters/character/name", new BeanPropertySetterRule("name") );
rules.add( "plays/play/characters/character/description", new BeanPropertySetterRule("description") );
digester.push(plays);
InputStream input = getClass().getResourceAsStream("./plays.xml");
digester.parse( input );
System.out.println("Number of plays: " + plays.size());