On the song "The Answer's Not in Washington," composer Orrin Hatch — yes, Sen. Orrin Hatch — cautions against relying on the institutions and operations of government to cure society's ills.

"We pay our taxes then expect a miracle to come," he laments. "We legislate, we demonstrate, but when all is said and done, the answer's not in Washington where bills and laws are passed, it's in the hearts of honest men who have the will to act."

For years, Hatch, the senior Republican senator from Utah, has quietly moonlighted as a songwriter and lyricist. He composed that song in the late 1990s, shortly before he was elected to his fifth term in the Senate, and, with the help of some professional musicians, pressed it to CD.

At the time, it captured a core part of his political philosophy. But the song took on new meaning this week, sounding a bit more like an epilogue to the Utah Republican's 41-year career in Congress.

On Tuesday, Hatch announced his plans to retire at the end of 2018 rather than seek re-election. First elected in 1976, he will finish the year as the longest-serving Republican senator in history.

"Every good fighter knows when to hang up the gloves," he said.

When he leaves Congress, the 83-year-old will give up his role as president pro tempore, as well as his chairmanship of the powerful Senate Finance Committee. But there's nothing stopping him from continuing his longtime side-gig as a songwriter.

Hatch, a trained pianist and a poetry aficionado, has composed hundreds of songs with a coterie of creative partners since the mid-1990s. Most are patriotic anthems, love songs and religious fare, with a few power ballads sprinkled in. For a while, he kept a running list of many of them on the now-defunct personal site hatchmusic.com.

He has even found some modest success. He has self-released more than a dozen albums featuring professional musicians performing his work. Gladys Knight has covered his songs, as have Christian pop singers and a handful of country musicians. In 2005, he brought in more than $39,000 in royalty earnings, as the New York Times reported at the time.

Hatch, a lifelong Mormon, didn't start writing until 1996. That year the popular Mormon songwriter Janice Kapp Perry approached him and asked if he would work on a few hymns with her.

"Orrin took this as a compliment but didn't believe that Janice was serious, until four months later when they bumped into each other at another event, and Janice again presented her request," reads an archived biography page on Hatch's music website. "That weekend he sat down and wrote 10 songs for her."

Those songs became his first album, “My God Is Love,” and marked the start of a long artistic collaboration with Perry.

Indeed, Hatch's catalog of songs is extensive, and a search of YouTube, Spotify and the music database AllMusic turns up a bevy of highlights.

One is "Everything and More," a tender acoustic love ballad co-written by Hatch and performed by country music star Billy Gilman on his 2005 album of the same name.

"Your love is like a river, it runs through my heart and soul. It's deep when I'm thirsty, and warm when I'm cold," croons Gilman, singing Hatch's lyrics. "And when I feel forgotten I come running to your shore, and find peace of mind time after time, you give me everything and more."

"Souls Along the Way," a deeper cut, is Hatch's tribute to the late Sen. Ted Kennedy, D-Mass., and his wife, Victoria Reggie Kennedy. It's a sentimental ode to the two lovers scored with strings and piano and performed by singer Felicia Sorensen. Hatch said he wrote it at the beginning of the Kennedys' relationship but only posted it to his public YouTube page after fans requested it. "Every time I hear it I am reminded of the love that Ted had for Vicki and how fortunate he felt to have her in his life," Hatch wrote.

Hatch had an affinity for love songs, as he told ABC News in 2015. In the segment, an interviewer asked him if he thought people would be surprised to know that about one of the highest-ranking officials in government.

"It's taken my mind off of some of the pain here," Hatch said. "I think it might be something to be a little uplifting to people, that I have some love ideas in my mind. I love writing love songs."

On his album "Heal Our Land: A Prayer for Our Country," released at the turn of the millennium, Hatch offers a deeply pious love letter to a country whose moral and civic values had, in the author's eyes, drifted. It's part rock, part musical theater, part hymn, all composed with Perry.

The tracks are lush with woodwinds, piano, strings, vocal harmonies and even some organ, along with some more traditional rock instruments. There are ballads, devotional songs and soliloquies from a range of patriotic characters who all seem to channel different aspects of Hatch's love of country.

"Someday I'll Fly," the second track, tells the story of Hatch's brother Jesse, who was killed when his B-24 bomber was shot down over Austria in World War II. "Watch, little brother, someday I'll fly, up toward heaven toward clear blue skies," read the lyrics by Hatch, who was 8 years old when his brother died.

A more lighthearted moment comes with the triumphant, Lee Greenwood-esque "America Rocks!", which sounds very much liked you'd expect. Over a twangy, distorted guitar hook, a chorus of America-loving singers chant: "America rocks! From its busy bustling cities to its quiet country walks, America rocks! It's totally cool, it's totally hot, I mean it's like right there at the top, America rocks!"

Later comes "The Answer's Not in Washington," which bemoans the "people breaking all the rules that keep our country free" and "disregard for the many things that make our country great."

But in the end all the gloom and doom gives way to a hopeful coda: "We must help each other," Hatch reminds his audience, "for when all is said and done, the answers won't be found in Washington."