As Sergey suggested, the "big win" here would be to get whatever is producing your data formatted as string into JSON, or XML format; parsing those formats to a Tree data structure, or creating a populated TreeView Control using those formats, is straightforward.
If you are going to try and use data in the format you show here, need to get your data into "well formed" shape. Your current data:
<program>
<var_declaration>
<primitive type="" bita="">
<identifier variable="">
=
<expression 25="">
;
>
<eof>
></eof></expression></identifier></primitive></var_declaration></program>
Is obviously not formatted systematically. There are many ways you could do that; for example:
<program>
<var_declaration>
<primitive type="" bita="">
<identifier variable="">
<expression 25="">
>
>
></expression></identifier></primitive></var_declaration></program>
Translating this to some Tree structure is not that difficult, but, to do so, one needs to know what types of objects (classes, structs, enums, etc.) are being created in the case of using some generic Tree (not a Control). If using a Control like a TreeView, then you have to decide what kind of naming scheme you want to use for the Nodes.
I've written several types of parsers from string to Tree/TreeView over the years, and if you show you have made an effort to implement your own here, I'll be happy to respond further ... as, I am sure, other people will also. You can also find examples on the net.