I have my xml file which is in this format:
<?xml version="1.0" encoding="utf-8"?>
<Performance>
<transaction name="Home">
<request transaction="Home">
<URL>http://192.168.0.7:23267/</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>200</RESPONSE-CODE>
</request>
<request transaction="Home">
<URL>http://192.168.0.7:23267/images/banner.JPG</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>200</RESPONSE-CODE>
</request>
<request transaction="Home">
<URL>http://192.168.0.7:23267/favicon.ico</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>404</RESPONSE-CODE>
</request>
</transaction>
<transaction name="Login">
<request transaction="Login">
<URL>http://192.168.0.7:23267/Login.aspx</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>200</RESPONSE-CODE>
</request>
<request transaction="Login">
<URL>http://192.168.0.7:23267/images/banner.JPG</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>304</RESPONSE-CODE>
</request>
<request transaction="Login">
<URL>http://192.168.0.7:23267/favicon.ico</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>404</RESPONSE-CODE>
</request>
<request transaction="Login">
<URL>http://192.168.0.7:23267/Login.aspx</URL>
<METHOD>POST</METHOD>
<RESPONSE-CODE>302</RESPONSE-CODE>
<Content-Type>application\x-www-url-encoded</Content-Type>
<Request_Body>__VIEWSTATE=%2FwEPDwUKLTIyNjM0Mjg2OGRki4v1QSB8PsGDDRUcxLe8nvnfdRE%3D&__VIEWSTATEGENERATOR=C2EE9ABB&__EVENTVALIDATION=%2FwEWBAL985OpBAKNo6vIDwLIoPPsBAK63N3jDihcqbsKpbaFs%2FjuUd7THytQsuqK&ctl00%24ContentPlaceHolder1%24username=aadi&ctl00%24ContentPlaceHolder1%24password=aadi1234&ctl00%24ContentPlaceHolder1%24log=Login</Request_Body>
</request>
<request transaction="Login">
<URL>http://192.168.0.7:23267/securepage/SecurePage.aspx</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>200</RESPONSE-CODE>
</request>
<request transaction="Login">
<URL>http://192.168.0.7:23267/images/banner.JPG</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>304</RESPONSE-CODE>
</request>
</transaction>
<transaction name="Logout">
<request transaction="Logout">
<URL>http://192.168.0.7:23267/securepage/SecurePage.aspx</URL>
<METHOD>POST</METHOD>
<RESPONSE-CODE>302</RESPONSE-CODE>
<Content-Type>application\x-www-url-encoded</Content-Type>
<Request_Body>__VIEWSTATE=%2FwEPDwULLTIwMDIzMDY0MjdkZLJV17BO2R5dj5TTwq3Xxpx8sGBn&__VIEWSTATEGENERATOR=0900BECB&__EVENTVALIDATION=%2FwEWAgKd%2BtjcCAKA4sljkvXRoUoTS7vStAm0LmWvI9N4A0w%3D&ctl00%24ContentPlaceHolder1%24Button1=Logout</Request_Body>
</request>
<request transaction="Logout">
<URL>http://192.168.0.7:23267/securepage/Login.aspx</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>302</RESPONSE-CODE>
</request>
<request transaction="Logout">
<URL>http://192.168.0.7:23267/Login.aspx?ReturnUrl=%2fsecurepage%2fLogin.aspx</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>200</RESPONSE-CODE>
</request>
<request transaction="Logout">
<URL>http://192.168.0.7:23267/images/banner.JPG</URL>
<METHOD>GET</METHOD>
<RESPONSE-CODE>304</RESPONSE-CODE>
</request>
</transaction>
</Performance>
I want to parse this file and read each transaction tag attribute as a root of treeview i.e. for example Home will be a root node of treeview and then URL tag value as its child node and same thing for all transaction and URL tags means Login as root node than respective URL tag value as its child node.