title: Edit TreeView Nodes from XML document
body: <p>I have one XML file that look like this:-
  <a href="https://i.stack.imgur.com/IqORC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IqORC.png" alt="XML file"></a></p>
  
  <p>I want to display it like this image:-
  <a href="https://i.stack.imgur.com/XH42G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XH42G.png" alt="Required output"></a></p>
  
  <p>How can I re-format/populate the output for each node like in the image? I have tried populate treeview from XML using below code:</p>
  
  <pre><code>private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
      {
          if (inXmlNode is XmlElement)
          {
             foreach (var att in inXmlNode.Attributes.Cast&lt;XmlAttribute&gt;().Where(a =&gt; !a.IsNamespaceDeclaration()))
              {
                  inTreeNode.Text = FirstCharToUpper(att.Name) + ": " + att.Value;
              }
  
              foreach (XmlNode xNode in inXmlNode.ChildNodes)
              {
                  var tNode = inTreeNode.Nodes[inTreeNode.Nodes.Add(new TreeNode(xNode.Name))];
                  AddNode(xNode, tNode);
              }
          }
          else
          {
              inTreeNode.Text = (inXmlNode.OuterXml).Trim();
          }
          treeViewMenu.ExpandAll();
      }
  </code></pre>
  
  <p>And I get the output like this:-
  <a href="https://i.stack.imgur.com/K6Jyb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K6Jyb.png" alt="Tree view"></a></p>
  
  <p>Already refer to this post: <a href="https://stackoverflow.com/questions/9174402/replacing-the-innertext-of-an-xml-node-element">Replacing the innertext of an Xml node/element</a></p>
  
  <p>However I still unclear about the flow or at which part I have to change.</p>