Data can be stored in child elements or in attributes.
Take a look at these examples:
<person sex="female"> <firstname>Anna</firstname> <lastname>Smith</lastname></person>
<person> <sex>female</sex> <firstname>Anna</firstname> <lastname>Smith</lastname></person>
In the first example sex is an attribute. In the last, sex is a child element. Both examples provide the same information.
There are no rules about when to use attributes, and when to use child elements. My experience is that attributes are handy in HTML, but in XML you should try to avoid them. Use child elements if the information feels like data.