The way I read this - based on the bash manpage section on REDIRECTION - is that stdin (fd0) is redirected into fd4, then input is taken from /etc/XX/cfg into stdin - which will end up on fd4.
read line1 should then take from fd4 which is then put back to fd0.
A demo might show my meaning a little better and answer "why" you might do this. By adding another line and putting it in a wrapper:
$ vim ./test.sh
#!/bin/bash
exec 4<&0 0</etc/XX/cfg
read line1 # reads from fd4
exec 0<&4
read line2 # reads from fd0
echo $line1
echo $line2
You can pipe or redirect stdin via test.sh but also read in configuration by redirection, so in the code above I've pulled in values from the "config" (assumption on my part based on the filename - bad :) ), but I can process via stdin as well.
e.g:
$ ./test.sh < somefile
$ cat somefile | ./test.sh
Hopefully this explains it.