I need to parse an xml file in java and store it in an array for sorting later. The xml file has this format
<Experiments>
<Experiment ID="312" RIndex="3" DIndex="3">40231</Experiment>
<Experiment ID="481" RIndex="2" DIndex="5">23801</Experiment>
<Experiment ID="102" RIndex="1" DIndex="5">41231</Experiment>
</Experiments>
For each experiment, the RIndex, DIndex and experiment values has to be stored. The most straight forward way I thought was a 2D array, but there's a function where I need to sort by one of those attributes (RIndex, DIndex or Experiment value). I thought of using ArrayList of collections too. Is this the best way to do it?