List emails = new ArrayList();
Map vars = new HashMap();
vars.put("email.to", "tobrien@discursive.com");
vars.put("user.name", "Tim");
vars.put("order.id", "1RR2E223WVVS" );
vars.put("product.name", "Foundation" );
MultiVariableExpander expander = new MultiVariableExpander();
expander.addSource("$", vars);
Substitutor substitutor = new VariableSubstitutor(expander);
InputStream input = getClass().getResourceAsStream("./email.xml");
URL rules = getClass().getResource("./email-rules.xml");
Digester digester = DigesterLoader.createDigester(rules);
digester.setSubstitutor(substitutor);
digester.push( emails );
digester.parse( input );
System.out.println("Resulting Email: " + emails.get(0) );