What kind of foam do you want to use? There are several out there. Usually a good knife works on all foams, heat blade or wire best on styrofoam, pink, blue and green foam.
XPS (yellow with a sandy surface) is heat proof and used for roofs, hence a rasp or a knife are your best bets.
Check out the "Pink foam" thread, awesome knowledge collection and application examples in there !
Thanks for all your great replys guys. Which kind of foam...hummm...difficult to say as I'm not an expert but let's say that it is a black hard foam, very dense...you can't push in it with your fingers for exemple.