i tried to get the number childnodes from a tag in a xml.But its showing even the nodes inside the child nodes.Can anyone correct me...???

Java Code:
package edc;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.NodeList;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

public class ReadXML 
{
    NodeList nodelist;
    public static void main(String [] args)
    {
        ReadXML obj = new ReadXML();
        obj.parse();
    }
    public void parse()
    {
        
        try
        {
            DocumentBuilderFactory docfact  = DocumentBuilderFactory.newInstance();
            DocumentBuilder docbuilder      = docfact.newDocumentBuilder();
            Document doc;
            doc                             = docbuilder.parse("d:/files/edc.xml");
            nodelist                        = (NodeList) doc.getElementsByTagName("date");
            int dateNodecount               = nodelist.getLength();
                     
            for(int i=0;i<dateNodecount;i++)
            {
                int count                   = nodelist.item(i).getChildNodes().getLength();//getNodeName();
                System.out.println(count);
            }
        } 
        catch (SAXException ex) 
        {
            Logger.getLogger(ReadXML.class.getName()).log(Level.SEVERE, null, ex);
        } 
        catch (IOException ex) {
            Logger.getLogger(ReadXML.class.getName()).log(Level.SEVERE, null, ex);
        }        catch (ParserConfigurationException ex) {
            Logger.getLogger(ReadXML.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}



here is my xml:


[CODE]
<edc>
<date value = "28-8-2009">
<classroom value = "c1">
<session id = "3" language = "english" lic_type = "l.v" lesson_code = "l1" st_cnt = "12" staff_id = "staff-01">
</session>
</classroom>
<classroom value = "c1">
<session id = "4" language = "english" lic_type = "l.v" lesson_code = "l2" st_cnt = "12" staff_id = "staff-01"/>
</classroom>
<classroom value = "c2">
<session id = "1" language = "urudu" lic_type = "l.v" lesson_code = "l1" st_cnt = "17" staff_id = "staff-02"/>
</classroom>
<classroom value = "c2">
<session id = "2" language = "urudu" lic_type = "l.v" lesson_code = "l2" st_cnt = "17" staff_id = "staff-02"/>
</classroom>
</date>
<date value = "29-8-2009">
<classroom value = "c1">
<session id = "3" language = "english" lic_type = "l.v" lesson_code = "l3" st_cnt = "12" staff_id = "staff-01"/>
</classroom>
<classroom value = "c1">
<session id = "4" language = "english" lic_type = "l.v" lesson_code = "l4" st_cnt = "12" staff_id = "staff-01"/>
</classroom>
<classroom value = "c2">
<session id = "1" language = "urudu" lic_type = "l.v" lesson_code = "l3" st_cnt = "17" staff_id = "staff-02"/>
</classroom>
<classroom value = "c2">
<session id = "2" language = "urudu" lic_type = "l.v" lesson_code = "l4" st_cnt = "17" staff_id = "staff-02"/>
</classroom>
</date>
</edc>
[/CODE]