There's no hard and fast rule. I tend to use attributes for metadata about the data contained in the elements. e.g
<book author="JK Rowling" published="September 2001">Harry Potter</book>
although usage/particular requirements will determine this more than anyrhing else.
Another issue is the subsequent processing. If you're using a SAX processor then this format will result in one method callback with the atteribute structure populated. Putting the data in multiple elements will result in the corresponding number of method calls (this may be an optimisation too far, but it may be worth considering depending on the quantity of data)