Error: org.apache.xerces.dom.DeferredTextImpl cannot be cast to org.w3c.dom.Element
Before downcasting to Element ,check this
Hint:- Just need to check the Nodeis an Element or not . Following is the way to convert Node into Element.
NodeList nodes = root.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
if(nodes.item(i).getNodeType() == Node.ELEMENT_NODE){
Element element = (Element) nodes.item(i);
..............................................
}
]