builder.startElement( new QName( "recipients", MailModule.NAMESPACE_URI, MailModule.PREFIX ), null );
// To Recipients
Address[] toAddresses = message.getRecipients( Message.RecipientType.TO );
if( toAddresses != null ) {
for (Address to : toAddresses) {
builder.startElement( new QName( "recipient", MailModule.NAMESPACE_URI, MailModule.PREFIX ), null );
builder.addAttribute( new QName( "type", null, null ), "to" );
builder.characters(to.toString());
builder.endElement();
}
}