The tallest prisoner counts the white hats in front of him. If odd, he calls out "white"; if even he calls out "black".
Then each prisoner down the line makes the same calculation. If the color they compute is different from what was called out before them, they know their color is "white"; if it's the same, their color is "black". They call out their color.
The secret is the shared information each prisoner has: they can see everyone's hat who is shorter than they are. So progressing from shortest to tallest, each prisoner adds one bit of information. The tallest is missing one bit, but fortunately the puzzle only requires that N-1 have the right answer. :)
Let's assign value 1 to white and 0 to black.
The number of white hats visible to any prisoner is the XOR of the hat value of everyone shorter than they are. So an even number of white hats will XOR to 0; an odd number will XOR to 1. Every prisoner can compute their XOR value by looking at those who are shorter. The shortest sees none so he defaults to 0.
The tallest prisoner starts with a guess that the previous prisoner called out "black" (0).
Each prisoner hears the previous prisoner's color, and knows his owh visible XOR value. If they match, he knows his hat didn't flip the XOR, so it is "black" (0); if different, he knows his hat did flip the XOR, so it is "white" (1).