Following code shows how we can use DocumentBuilder to get NodeList object.
File file = new File("C:\\abc.xml");
DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(file);
NodeList nodes = doc.getElementsByTagName("student");
...