Navigates XML tree to convert into json format