The first is the verbose way of doing things: Everything is an element. This is a common way that people do this simply because it's so easy to look at and parse.
However, attributes were introduced for just this reason: they're bits of information about the element. So, your second example is perfectly acceptable. In fact, you could even shorten it:
I would probably do the latter.
The only time you wouldn't want this is if you need to have more xml data inside, or long formatted sections.