K Shell Help needed

Could someone tell me the code for doing the below inside a k shell?

I have a file file below:

$ more file1
>>>>>
AAA
BBB
CCC
<<<<<
>>>>>
DDD
EEE
FFF
<<<<<

I want the lines between ">>>>>" and "<<<<<" to be one line like below:

AAA BBB CCC
DDD EEE FFF

Any help will be greatly appreciated.

#! /bin/ksh

while read line
do

        if [[ "$line" == *">>"* ]] ; then
        TXT=""
        elif [[ "$line" == *"<<"* ]] ; then
        echo "$TXT"
        else
        TXT="$TXT$line "
        fi ;

done < file1

That's great!
I appreciate your quick and accurate reply everytime!
Thanks alot vino!