I don't think there is any "official" way of doing this. For me personally, though, it depends on what is the meaning of these elements/variables. Are they supposed to behave fundamentally differently from one another? Or are their function the same and only the parameters are different?
In your example, it seems their function is the same - they are just variables. Their parameters are different - the name and the value. Therefore, I would say that the second form is better, since you want to handle them all in the same way - probably load them into some kind of map or the like, right?
On the other hand, if their function was supposed to be different, then I would suggest to use different tag names for each. For example:
<post>
<content>Abc</content>
<comment>Xyz</comment>
</post>
Is definitely better than
<post>
<text type="content">Abc</text>
<text type="comment">Xyz</text>
</post>
Since content and comment are fundamentally different entities that you probably want to handle differently.
So all in all it is pretty similar to OOP programming. Would you create a separate class for each variable? I don't think so, you would just create a single class named "Variable" and instantiate it with different constructor arguments. On the other hand, if the logic was different, like in the second example, you would probably prefer to create a separate class (possibly with different fields) for storing contents and for comments.