I have an XML as bellow.
<hotelRoomDetails>
<NightRates>
<Night1>67</Night1>
<Night2>67.5</Night2>
........
........
<Night25>65</Night25>
</NightRates>
.......
</hotelRoomDetails>
The element Night1,Night2,Night3 are always dynamic, and this count may vary from 1 to 35 times. Parent tag <NightRates>
is always consistent.
The element <Night1>
, <Night2>
.. are not having any other attribute. It gives information about the hotel rate per night.
I want to create a 'LinkedList'(to preserve order) which contains the rate information of individual night. How can I handle this situation without knowing the occurrence count of element? How to create java class for this xml?