Welcome!
Hi Derrick,
Welcome to The XLR Site.
There are a number of things that can cause the retractable hard top to act up. Besides taking it to a "Qualified Cadillac Dealer" ($), here are 'some potential issues/causes' that must be diagnosed correctly. As in,
"A Successful Repair Begins with An Accurate Diagnosis"!
Potentials?:
Low Batter Voltage, or a Weak Battery. These cars do all kinds of weird stuff even if the battery may test 'OK, but on the Weak Side' of the spectrum. Went through this with mine three years ago. Probably time for me to replace the battery again. The XLR's have more parasitic battery drain (just sitting) than any vehicle I have ever owned. Have the battery Load Tested at an O'Reilly's etc. If it tests good but on the weak side, replace it. --- When your XLR is sitting warm and cozy in the garage always keep it on a Battery Tender. ---
Water having gotten into the lower left trunk area where the electronics are housed for the top operation. Pull back the carpet and the cover and inspect. Make sure the weep/drain hole at the bottom is not plugged. If water soaked and fried it as a result, replace parts as required and make sure trunk deck lid surround seals are good to prevent future water intrusion. ---
Pumps/Hydraulics Failure and/or Electrical Failures. Do a visual inspection of contact points and wires for any abrasion and or dirty contact points at connections and or sensors and relays. A schematic and 12V Test Probe and or Multi Meter is called for here. If Electrical issue (not caused by weak 12V battery) scan the system with a Tech II Scanner and at the least, an OBDII Scanner (not as good as a Tech II) to point one in the right direction.
Make sure that none of The Lift Arms are bent or out of ralignment. Visual inspection. A spritz of WD40 wouldn't hurt at hinge pivot points.
Not knowing specifically what kind of retractable top issues you are having as you did not describe them (?), I would start first having the battery Load Tested. Presently, mine is also acting up,
'again'. Ex., When I retracted the top the deck lid would raise and the top would fold into the cavity, but the deck lid would not go down and close while I was holding down the console button? I'd have to release the console button, then press it again with more authority. Then the deck lid went down. Yet the deck lid button on the trunk worked properly? --- So what did I find and do? (1) Checked voltage range at console switch (Multi Meter) and cleaned the switch terminal blades at the console button and Checked Sensors for Ohms resistance. --- Cleaned the contact switch points at the console switch. Walla! Trunk deck lid now closes. Yet sluggish (slow) not a crisp reaction as previous? Sensors tested good against known (Repair Manual) specs. Problem at final diagnosis? "
A weak" (not failed yet) 12V Battery". So, will replace it 'again'.

As in "Oh Well, Here we go again". Another NEW Battery! Est., about once every three years.

--- Personally, I do not like the looks of the GelCel Battery's with their round chambers and usually 'red' color. Yet they are more reliable than a regular lead acid battery and last longer. --- May go that route though this time? Haven't decided.
Again, These are just some ideas to possibly point you in the right direction if you are comfortable trying to diagnose and do the work yourself? If not? Find a qualified Cadillac XLR Repair Shop (most likely a Cadillac Dealer) and have them diagnose and repair the issue. Herein lies another issue.
Trying to find a "Real Well Qualified XLR Tech". Many Dealers are like "Oh yes, All our Techs are well qualified ASE Certified and Cadillac Trained". --- FYI, often this is just 'Bull Hockey". The XLR Cadillac Technician Certification is and was a specialty designation by Cadillac. --- So make sure whatever Technician you choose really does know these cars!!!
Again, Welcome!