XP falls into two categories for me, Session XP and Chapter/Story XP.
Everytime you show, you get Session XP. You don't show- you don't get Session XP.
Everytime you finish up a "Chapter" (usually like getting a major accomplishment done) in the story you get roughly another Session of XP automatically. Players who missed sessions during that stretch of time that was the Chapter, get a proportional amount of that XP.
As mentioned above, its not a matter of punishment so much as it is a matter of earning and contributing to the story. Players who never miss games and are thusly always at risk of dying and working the most hours to work within the setting get what they deserve. I wish I didn't have to do these things, but I do have one player who has an attendance rate of 20% currently and can't justify him being even close to the XP totals of my players with 90-100% attendance.
And I dunno about every campaign, but in mine, absent players make for errant characters- they aren't in the fights, they aren't in discussions, and usually they aren't even in a 5 mile radius of the party. Rather than being off-frame in a game where a session can easily encompass months of game time, characters for me are usually off doing their own thing (invariably resting / studying lore) ala Record of Lodoss War. The only danger had for these missing characters is that, without them, the PCs may TPK- ending the campaign.
And to pick up on the thread's tangent,
When the players mess up and die horribly they also get what they deserve. ^_^ I thoroughly dislike the idea that the storytelling aspect of RPGs insists that a single character survives an entire campaign or only dies when his player wants him to die. I appreciate the improvisation that the dice demand of player characters, be it describing a cool swing, rolling poorly, and then adjusting that description- or even tackling the unexpected loss of a companion in battle. That safety net of "no one dies in fantasy land" just shoots down an entire aspect of the creative process of the fiction in my mind. I won't attempt to push too far into the meat of it- but I dislike it being partially random/partially fixed... this makes for potentially bumbling heroes who do the worst things, roll the worst results consistantly, and yet are crowned heroes. It just creates this big sucking sound of realism blowing out the campaign for me. Of course, people tend to excuse this as "heroic fiction" or "action movie fiction" to which I can only respond that in those movies, all the d20's are numbered 15-20 for the protagonists, and 1-15 for the mooks.
If my character deserves death, bring it on.