I want to parse local XML file as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<categories>
<category>
<id>1</id>
<name>Main name</name>
<subcategories>
<count>1</count>
<subcategory>
<id>2</id>
<name>Sub name</name>
<products>
<count>5</count>
<product>
<id>1</id>
<name>fullname</name>
<description>this is full name and something</description>
<color>white</color>
<size>xyz</size>
<images>
<count>2</count>
<image>
<title>test</title>
<url>www.test.com/test1.jpg</url>
</image>
</images>
</product>
</products>
</subcategory>
</subcategories>
</category>
<category>
<id>2</id>
<name>other name</name>
<subcategories>
<count>1</count>
<subcategory>
<id>2</id>
<name>other name subname</name>
<products>
<count>5</count>
<product>
<id>1</id>
<name>patname of othername</name>
<description>this isapt name and something</description>
<color>white</color>
<size>xyz</size>
<images>
<count>2</count>
<image>
<title>test</title>
<url>www.test.com/test1.jpg</url>
</image>
</images>
</product>
</products>
</subcategory>
</subcategories>
</category>
</categories>
How can I parse this local XML file in Android and how can I use it's inner tag like here in tag category it have id 1 and 2 so if id of category is 1 than print or user it's all inner tag content of that category and so on. And how can I use content of the both category's inner tag in Android?