i want to count the depth of an XML file like this :
<?xml version="1.0" encoding="iso-8859-1"?>
<country> -----> Level 1
<name> France </name> ----> Level 2
<city> Paris </city>
<region>
<name> Nord-Pas De Calais </name> ---> Level 3
<population> 3996 </population>
<city> Lille </city>
</region>
<region>
</region>
</country>
You could use this and customize as per ur needs… Using DOM parser
public class Test {
}