a hacksaw blade is your best friend when working with foam, either the 'normal' foam or expanda foam, I use a butane torch on the normal foam to dissolve the saw marks, I did try the torch on the expanda foam, and it didnt do much of anything really, but i'm not heavy handed with the torch, i only ever give it a quick wave over the surface, Going by what Virides has just explained I'm glad I dont.
Now I only use expanda foam like polyfilla, to fill large gaps