While this is not a hard rule, and more of style treatment, the W3Schools provides the following explanation:
Attributes often provide information that is not a part of the data.
In my experience, this is a good guideline to follow. When I build XML applications, I follow this guideline and use attributes strictly for metadata of an element, and sub-elements for data that the element manages. To do this I ask questions like "Is this data about the XML entity (metadata)? Or is this data managed by the XML entity (stored data)?" Generally this gives a good indication of when the information is an attribute, or a sub-element.
For example. If I have the following collection of data that I need to organize in XML:
CustomerNumber="001"
FirstName="John"
LastName="Joe"
ProcessedDate="July 30, 2011"
I would organize the data in XML as follows:
<Customer processedDate="July 30, 2011">
<CustomerNumber>001</CustomerNumber>
<FirstName>John</FirstName>
<LastName>Joe</LastName>
</Customer>