I had an issue with two of my transmission lines like that. the line was just wet with the stuff, not really a leak but just wet.
my line was about half rubbery flexible and the other was rigid. I ended up getting it at napa (or similar) and it was already in the form it needed to be in.
I just chocked it up to age as this was less than a year ago making them in the neighborhood of 13 years old.
you may be good just changing it out. check the napa site out to see if you can find something similar to what you need. I always chose their purchase online option and it gives me an idea of the price I will pay. so far, the local price has been cheaper on everything I have bought there.
****edit****
for reference, here are what mine looked like. I did a search for transmission oil cooler line.