Nieostrożny XML w tablicach

Chcę uniezależnić plik XML od tablicy elementów.

Przykład:

<root>
   <animal>
      <name>barack</name>
   </animal>
   <animal>
      <name>mitt</name>
   </animal>
</root>

Chciałbym tablicę elementów zwierzęcych.

Kiedy próbuję

JAXBContext jaxb = JAXBContext.newInstance(Root.class);
Unmarshaller jaxbUnmarshaller = jaxb.createUnmarshaller();
Root r = (Root)jaxbUnmarshaller.unmarshal(is);
system.out.println(r.getAnimal.getName());

ten wyświetlaczmitt, ostatnie zwierzę.

Chciałbym to zrobić:

Animal[] a = ....
// OR
ArrayList<Animal> = ...;

Jak mogę to zrobić?

questionAnswers(1)

yourAnswerToTheQuestion