XML Elements vs. Attributes Take a look at these examples Anna Smith female Anna Smith In the first example sex is an attribute. In the last, sex is an element. Both examples provide the same information. There are no rules about when to use attributes and when to use elements. Attributes are handy in HTML. In XML my advice is to avoid them. Use elements instead. My Favorite Way The following three XML documents contain exactly the same information A date attribute is used in the first example Tove Jani Reminder Don't forget me this weekend Don't forget me this weekend Don't forget me this weekend Don't forget me this weekend I will not Don't forget me this weekend Don't forget me this weekend Don't forget me this weekend