This was done on a ubuntu 9.04 box.
Basically, run this script in a folder of your choice:
#!/bin/bash
for i in `seq 1 329`
do
wget http://xkcd.com/$i/
wget `grep http://imgs.xkcd.com/comics/ index.html | head -1 | cut -d\" -f2`
rm index.html
done
Then, edit your screensaver config file as outlined in this blog:
gksu gedit /usr/share/applications/screensavers/personal-slideshow.desktop
then make the exec line like this:
Exec=slideshow --location=/home/username/Pictures/yourfolder