you need to modify your XPath
expression to select all the categories within your document no matter where they are within the document, as you have 1 parent category with child categories and then child categories within those child categories.
/root/category
- this will just select the parent category node (1 node) with many child nodes.
//category
- this should select all categories within the XML document no matter where they appear.