Found it, through a link from the Mudcat website - it's in the Bodleian Library's collection of broadside ballads. The words in these versions were clearly written during the Napoleonic wars, but no tune is given and I wonder whether the tune may be older. The words I learnt had definitely been cleaned up for schoolchildren.