RebelCom 0 Newbie Poster

I have the following XML file:

<graph caption="ECG Data Wave" subcaption="For Person's Name" xAxisName="Time" yAxisMinValue="-0.025" yAxisName="Voltage" decimalPrecision="5" formatNumberScale="0" numberPrefix="" showNames="1" showValues="0" showAlternateHGridColor="1" AlternateHGridColor="ff5904" divLineColor="ff5904" divLineAlpha="20" alternateHGridAlpha="5">
    <set name="12:00:00.01" value="0.600000" hoverText = "The difference from last value: 0" ></set>
     <set name="12:00:00.02" value="0.640000" hoverText = "The difference from last value: 0.04" ></set>
     <set name="12:00:01.025" value="0.340000" hoverText = "The difference from last value: -0.3" ></set>
     <set name="12:00:01.031" value="0.100000" hoverText = "The difference from last value: -0.24" ></set>
     <set name="12:00:01.039" value="-0.100000" hoverText = "The difference from last value: -0.2" ></set>
     <set name="12:00:01.050" value="-0.200000" hoverText = "The difference from last value: -0.1" ></set>
     <set name="12:00:02.01" value="0.010000" hoverText = "The difference from last value: 0.21" ></set>
     <set name="12:00:02.12" value="0.600000" hoverText = "The difference from last value: 0.59" ></set>
     <set name="12:00:02.23" value="0.500000" hoverText = "The difference from last value: -0.1" ></set>
     <set name="12:00:02.028" value="0.300000" hoverText = "The difference from last value: -0.2" ></set>
     <set name="12:00:02.031" value="0.100000" hoverText = "The difference from last value: -0.2" ></set>
     <set name="12:00:03.049" value="0.000000" hoverText = "The difference from last value: -0.1" ></set>
     <set name="12:00:03.145" value="-0.050000" hoverText = "The difference from last value: -0.05" ></set>
     <set name="12:00:04.12" value="0.110000" hoverText = "The difference from last value: 0.16" ></set>
 <trendlines>
   <line startvalue="0.30" displayValue="High Activity" color="FF0000" thickness="1" isTrendZone="0"></line>
   <line startvalue="-0.05" displayValue="Low Activity" color="009999" thickness="1" isTrendZone="0"></line>
</trendlines>
</graph>

I want to write a Java program that will allow users to select a starting range and an end range so that only those data points end up in the new file. For example, suppose the user wants the 2nd value to the 6th value so the new XML File is as follows:

<graph caption="ECG Data Wave" subcaption="For Person's Name" xAxisName="Time" yAxisMinValue="-0.025" yAxisName="Voltage" decimalPrecision="5" formatNumberScale="0" numberPrefix="" showNames="1" showValues="0" showAlternateHGridColor="1" AlternateHGridColor="ff5904" divLineColor="ff5904" divLineAlpha="20" alternateHGridAlpha="5">
<set name="12:00:00.02" value="0.640000" hoverText = "The difference from last value: 0.04" ></set>
     <set name="12:00:01.025" value="0.340000" hoverText = "The difference from last value: -0.3" ></set>
     <set name="12:00:01.031" value="0.100000" hoverText = "The difference from last value: -0.24" ></set>
     <set name="12:00:01.039" value="-0.100000" hoverText = "The difference from last value: -0.2" ></set>
     <set name="12:00:01.050" value="-0.200000" hoverText = "The difference from last value: -0.1" ></set>
 <trendlines>
   <line startvalue="0.30" displayValue="High Activity" color="FF0000" thickness="1" isTrendZone="0"></line>
   <line startvalue="-0.05" displayValue="Low Activity" color="009999" thickness="1" isTrendZone="0"></line>
</trendlines>
</graph>

How is the best way to achieve this?

Regards,
RebelCom