the script iterates over sections defined in the first loop
then in thecond loop it iterates over config entitiels got from list command
and pipes the xml dump into aproproate file in the ${PWD}
This is how i use the script normally
You can add more sections from libvirt like: