Developers often need to parse an XML document in order to get XML document nodes, child nodes and so on. But usually we have no idea how far the depth/nesting of child nodes can go. So we need some form of recursive technique to loop the nested nodes and help us grab the values we want.