How to create a file and mount it as a filesystem

As seen over on How do I create a file and mount it as a filesystem? the answer is that you need to use the -o loop option:

mount -o loop /path/to/file /path/to/mount