Tom, the piper's son seems to have had several adventures in the nursery rhyme canon. This familiar rhyme, with its march-like tune, has a consistent first verse, but I haven't been able to pin down any subsequent verses as 'right'. The tune was used in the theme to ITV's series 'Sharpe', which also added its own verses, with more explicit references to the Napoleonic Wars. I believe the poem to be older than that.

Tom, he was a piper's son,
He learned to play when he was young.
But all the tune that he could play
Was 'Over the Hills and Far Away'.
Over the hills and a great way off,
The wind shall blow my top-knot off.