What resistor should I use when wiring 10 LEDs in series?
If you put all these LEDs in series you'll indeed need 38V, plus a bit for the series resistor. But you can make a circuit with several branches. Put 2 LEDs in series and you'll need 7.6V. So the remaining 9V - 7.6V = 1.4V is the voltage over your resistor. If you want 20mA through your circuit You divide this 1.4V / 20mA = 70 ohm, so a standard 68 ohm will do nicely.
Now that's for 2 LEDs, you could go for more if you had a higher voltage. the way to calculate the resistor is the same. If you want 10 LEDs from 9V, in theory you could put the circuit 5 times in parallel. That would be a total current of 100mA though (5 x 20mA), and that's a bit much for a 9V battery.
edit
It's been suggested that you could replace the 5 resistors by a single one, and branch from beneath this. In an ideal world that would be true; the resistor value would then be 1.4V / 100mA = 14 ohm. But this isn't an ideal world, and there may be small differences in LED voltages. In that case the branch with the lowest voltage will draw most of the current (100mA!) while the other LEDs will hardly light at all.
I recently made a circuit with 10 LEDs which works on 6 V. This site was of great help for me. You just supply parameters you gave us to it and it will produce a schematic of a circuit and will provide information on type of resistors which need to be used and so on.
Also, if you want to use a battery, check out its datasheet for its voltage when discharged. This way, you'll be able to calculate how well circuit works with used batteries.
Also, I agree on Leon Heller that 9 V batteries are a bad choice. the thing is that they start out at 9 V, but for example VARTA No.4922 battery has end voltage between 4.8 and 5.2 volts. It's too low to use 2 LEDs in series. Also capacity is lower than in the 1.5 V batteries.