Java Eclipse JDK Sun XPath DOM SAX XALAN

java.lang.ClassCastException: com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList
at ads.test.Encode.getDocument(Encode.java:57)
at ads.test.Encode.main(Encode.java:90)

com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList

org.apache.xml.dtm.ref.DTMNodeList
で競合していると思われる。

IBMのエクリプス・えくりぷすeclipseのバージョン3でのエラー

import java.io.*;
import java.net.*;
import javax.xml.xpath.*;
import javax.xml.parsers.*;
import org.xml.sax.InputSource;
import org.apache.xpath.NodeSet;
import org.xml.sax.InputSource;
import org.w3c.dom.NodeList;

public void getDocument(String xml){
try{
XPathFactory factory = XPathFactory.newInstance();
XPath xPath=factory.newXPath();
InputSource inputSource = new InputSource(new StringReader(xml));
String expression="//item";
NodeSet nodes = (NodeSet)xPath.evaluate(expression,inputSource,XPathConstants.NODESET);
int length = nodes.getLength();
echo(new Integer(length).toString());
for(int i=1; i<=length; i++){
expression = "//item[" + i + "]/title";
String title =xPath.evaluate(expression, inputSource);
echo(title);
expression = "//item[" + i + "]/summary";
String summary = xPath.evaluate(expression, inputSource);
echo(summary);
expression = "//item[" + i + "]/URL";
String url = xPath.evaluate(expression,inputSource);
echo(url);
}

}catch(XPathException e){
}
}