How do I kill the Enderdragon?

I've been battling away at this thing for a while, I always end up dead. I'm assuming you need to use some kind of trick or tactic to beat it, any idea what I should be doing?


OK, this seems to be the basics of the strategy required:

  1. Destroy the Ender Crystals that are on top of the obsidian towers. Until this is done, the Ender Dragon will keep regenerating at an impossible rate.

  2. Kill it by shooting at it until it dies.

    ?????

  3. Credits


I use the following strategy in survival mode:

  1. Avoid Enderman Attack:
    Wear a pumpkin hat.

  2. Destroy the Crystals:
    Shoot them with arrows.

  3. Dragon:
    Stay in water (which also helps keep endermen away) and attack it with everything I've got!