You need to add the -r a option for exporting applications contained within the application group. This part should be:
${ARSXML} export -h ${HOST} -u ${ADM} -p ${PW} -i ${XMLFILE} -r apl -v >${tempout}
${ARSXML} export -h ${HOST} -u ${ADM} -p ${PW} -i ${XMLFILE} -r apl -v >${tempout}