The best way I could figure out is to use another guest of some sort to do this, while assigning the disk that needs to be resized to the same guest.
So say we have /dev/xvda as the guests drive and we've booted it up.
We also have /dev/xvdb (this is going to be the image/disk to be resized).
In this case it's based on an ext3/4 image.
Run e2fsck on it to ensure there are no filesystem errors.
e2fsck /dev/xvdb
e2fsck 1.41.12 (17-May-2010)
root: recovering journal
root: clean, 20868/656640 files, 250543/2621440 blocks
Remove the journal so it really becomes an ext2 filesystem (this is because it cannot be resized directly as an ext3/4)
tune2fs -O ^has_journal /dev/xvdb
tune2fs 1.41.12 (17-May-2010)
Run e2fsck again just to make sure there are no errors after removing the journal
e2fsck /dev/xvdb
e2fsck 1.41.12 (17-May-2010)
root: clean, 20868/656640 files, 217775/2621440 blocks
Run e2fsck on the resized image (this seems silly but you'll get an error otherwise)
resize2fs /dev/xvdb 5120M
resize2fs 1.41.12 (17-May-2010)
Please run 'e2fsck -f /dev/xvdb' first.
e2fsck -f /dev/xvdb
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
root: 20868/656640 files (0.1% non-contiguous), 217775/2621440 blocks
Resize the image to whatever you would like (if this is a template make sure you don't resize it to something smaller than the currently used space or obviously you'll have a corrupt template/image)
resize2fs /dev/xvdb 5120M
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/xvdb to 1310720 (4k) blocks.
The filesystem on /dev/xvdb is now 1310720 blocks long.
*Re-enable the journal
tune2fs -O has_journal /dev/xvdb
xen, resize, properlythe, assigning, disk, resized, dev, xvda, ve, booted, xvdb, ext, fsck, ensure, filesystem, errors, recovering, fs, has_journal, removing, ll, inodes, sizes, directory, connectivity, reference, summary, contiguous, template, currently, corrupt, resizing, enable,