掏出XML格式中的数据

取出XML格式中的数据
求大神  在java中传入一个XML样式的String类型,现在要取节点中的属性值 ,并且根节点中的类会随着不同格式发生变化。 类似这样:
<com.dams.core.rest.entrys.FlightClrResult>
  <result>1</result>
  <flightList>
    <com.dams.msg.entity.sita.ClrMessageInfo>
      <id>3</id>
      <name>CLR</name>
      <type>CLR</type>
      <format>SITA</format>
      <flightNo>9C8846</flightNo>
      <flightDate class="sql-timestamp">2014-12-03 16:00:00.0</flightDate>
      <registNumber>B6708</registNumber>
      <estimatedTakeOff class="sql-timestamp">2014-07-24 01:20:00.0</estimatedTakeOff>
  <flightList>
<com.dams.core.rest.entrys.FlightClrResult>    例如取出type中的CLR  ,  format里面的SITA
------解决方案--------------------
参考这个了。 
------解决方案--------------------
正则 
String s="<id>3</id>" ;
s+="<name>CLR</name>" ;
s+="<type>CLR</type>" ;
s+="<format>SITA</format>" ;
s+="<flightNo>9C8846</flightNo>" ;
Matcher m = Pattern.compile("<type>(.*?)</type>.*?<format>(.*?)</format>").matcher(s);
while(m.find()){
System.out.println(m.group(1)+"****"+m.group(2));
}

------解决方案--------------------
http://ekekyn.blog.163.com/blog/static/313887320112155206521/
看下