Jim actually explained the rations, which was to deal with filnames containing spaces, he used the while loop in order to be able to put quotes around the filename.
Try your example with filenames with spaces and you will understand, with no spaces the xargs method is much more efficient.
However I believe the OP was asking for something more think this: