Extracting Tag along with specific lines

I have this input file:

and the desired output is as follows:
Desired Output

This is a sample taken from a huge file. Basically, the script should take the tag (TDK11..1>) add everything that has bukle=A until it sees the blank lines. Then takes the next tag (TDK2222>) adds everything that includes buckle=A and so forth for the entire sheet. Finally remove all the empty lines from the final file.

Danke!

Please, show what you've tried already and where exactly are you stuck.

I tried the following:

awk '{print $1, $5, $7}' stl.hi > stl1.hi
grep -v "^=" stl1.hi > stl2.hi

and

sed '/^$/d' stl2.hi > stl3.hi

Neither works. Not sure how to get the specific of Buckle=A

nawk -F, '/>/{print;next} NF { if($NF ~ "^Buckle=A[_]*") print $1, "Buckle=A"}' myFile

Not sure if you want to pick up Buckle=A and Buckle_A_OI (based on some of your previous posts).

$ nawk -F, 'NF>1&&/A$/{print$1,$NF}NF==1' infile
TDka1111111>
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
TDka2222222>
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
TDka3333333>
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
citernedlo=1 Buckle=A
$