List<MailingList> mailingLists = new ArrayList<MailingList>();
List<Element> mailingListElems = xml.getElementList( "//project/mailingLists/mailingList" );
for ( Element elemMailingList : mailingListElems )
{
MailingList mlist = new MailingList();
mlist.setName( elemMailingList.elementTextTrim( "name" ) );
mlist.setSubscribeAddress( elemMailingList.elementTextTrim( "subscribe" ) );
mlist.setUnsubscribeAddress( elemMailingList.elementTextTrim( "unsubscribe" ) );
mlist.setPostAddress( elemMailingList.elementTextTrim( "post" ) );
mlist.setMainArchiveUrl( elemMailingList.elementTextTrim( "archive" ) );
Element elemOtherArchives = elemMailingList.element( "otherArchives" );
if ( elemOtherArchives != null )
{
List<String> otherArchives = new ArrayList<String>();
List<Element> others = elemOtherArchives.elements( "otherArchive" );
for ( Element other : others )
{
String otherArchive = other.getTextTrim();
otherArchives.add( otherArchive );
}
mlist.setOtherArchives( otherArchives );
}
mailingLists.add( mlist );
}