let rec count_root_elem name l= 
        match l with
        | [] ->  0
        | element::tail -> 
        begin
                match element#node_type with
                | T_data ->  
                          count_root_elem name tail
                | T_element s -> 
                begin
                        (count_root_elem name tail)+
                                if (s=name) then
                                        1
                                else 
                                        0
                end;
        end