Whitman included this in his “Songs of Parting” collection. It was originally published in Drum-Taps in 1865 and can be found in earlier prose forms in an assortment of places. He did not only write about Union soldiers, although he is best known for his dedication to the men of the Federal Army.
Ashes of Soldiers
Ashes of soldiers South or North,
As I muse retrospective murmuring a chant in thought,
The war resumes, again to my sense your shapes,
And again the advance of the armies.
Noiseless as mists and vapors,
From their graves in the trenches ascending,
From cemeteries all through Virginia and Tennessee,
From every point of the compass out of the countless graves,
In wafted clouds, in myriads large, or squads of twos or threes or
single ones they come,
And silently gather round me.
Now sound no note O trumpeters,
Not at the head of my cavalry parading on spirited horses,
With sabres drawn and glistening, and carbines by their thighs, (ah
my brave horsemen!
My handsome tan-faced horsemen! what life, what joy and pride,
With all the perils were yours.)
Nor you drummers, neither at reveille at dawn,
Nor the long roll alarming the camp, nor even the muffled beat for burial,
Nothing from you this time O drummers bearing my warlike drums.
But aside from these and the marts of wealth and the crowded promenade,
Admitting around me comrades close unseen by the rest and voiceless,
The slain elate and alive again, the dust and debris alive,
I chant this chant of my silent soul in the name of all dead soldiers.
Faces so pale with wondrous eyes, very dear, gather closer yet,
Draw close, but speak not.
Phantoms of countless lost,
Invisible to the rest henceforth become my companions,
Follow me ever–desert me not while I live.
Sweet are the blooming cheeks of the living–sweet are the musical
But sweet, ah sweet, are the dead with their silent eyes.
Dearest comrades, all is over and long gone,
But love is not over–and what love, O comrades!
Perfume from battle-fields rising, up from the foetor arising.
Perfume all–make all wholesome,
Make these ashes to nourish and blossom,
O love, solve all, fructify all with the last chemistry.
Give me exhaustless, make me a fountain,
That I exhale love from me wherever I go like a moist perennial dew,
For the ashes of all dead soldiers South or North.
 Walt Whitman, The Works of Walt Whitman, (Hertfordshire: Wordsworth Editions, Ltd., 1995), 440-441.
The photograph is courtesy of the National Park Service