The two examples are not equivalent, because they form different hierarchies. Is a sitemap a list of categories, like the first example? Or is it a list of pages like the second example?
The answer to that is orthogonal to the element vs attribute question.
On the Element vs Attribute question:
Here is your second example transformed to an attribute approach:
<sitemap>
<page
category='Animals'
section='Dogs'
title='Great Dane'
url='/pics/greatdane.jpg'
/>
</sitemap>
The above and your second case are equivalent. One consideration for choosing one versus the other is based on whether you may modify the schema in the future. Adding an attribute to the url element as in the following example would likely be a backward compatable change. The semantically same modification would be impossible in the attribute approach, as you cannot attach an attribute to an attribute.
<sitemap>
<page>
<category>Animals</category>
<section>Dogs</section>
<title>Great Dane</title>
<url nofollow="true">/pics/greatdane.jpg</url>
</page>
</sitemap>