It should be fine doing a defrag of the drive online, since the Xen disk images are just files like any other. You should try to do this off hours as performance will likely suffer greatly during the defrag.
The reason you're seeing high fragmentation is that VDIs are sparse disk images. Even though you specify a VM has (for example) 100 GB of space allocated, the disk image will initially allocate only a minimal amount of space. It will then grow as needed up to a maximum of the allocated size. The problem with this approach is that if you have a lot of VMs on the same storage device and they're all growing their disks at different times, there is no way the disk image files will be able to be contiguous on disk and thus will become very fragmented.
The solution to this would be to not use sparse images, but unfortunately it seems that as of XenServer 5.0 the only VDI type you can make is sparse.
You have a couple of options I can think of off the bat:
* If possible, use raw block devices with the LVM format. I'm not familiar enough with Windows 2003 Storage Server to know if this is possible. If it allows you to make volumes an export them through iSCSI or FC, you're all set. Otherwise you might need to look at changing to some other shared-storage setup or something else.
* Preallocate all the disk space in your VHD. Essentially this means just fill up all the available space in the volume before installing your OS. You can boot a Linux LiveCD or something and use
dd to write zeros over the whole disk. This will cause XenServer to grow the disk image file to the full maximum size, and hopefully most of it will be contiguous since it is all being done at once.
The fragmentation problem you're seeing is not uncommon for using sparse file based storage for VM's, and is exactly the reason why I prefer to use LUNs on a SAN for VM storage instead.