‘He did go on,” the author says about W. H. Auden to the actor who is playing him – slightly unwillingly – on stage. “That was what he was like. He went on. And on. If you can show me a way of him going on without him actually going on I’d be very grateful.”

This speech, from Part One of The Habit of Art, helps to illustrate what Alan Bennett is up to in his beautifully crafted and enormously entertaining new work. We are presented with a play about Auden and Benjamin Britten fashioned around the rehearsal of another such drama which is likewise being staged at the National.

Caliban’s Day is the work of author Neil (Elliot Levey) who in attitudes, though not age or appearance, bears obvious similarity to Bennett himself. Its stars are the grumpily comic Fitz (Richard Griffiths) as the poet, the buttoned-up gay Henry (Alex Jennings) as the composer and the touchy, rather trying Donald (Adrian Scarborough) as the biographer of both, the Oxford-based author and broadcaster Humphrey Carpenter.

By throwing the three men together at an invented meeting (Britten was never there) in Auden’s chaotic cottage in Christ Church, Oxford, in 1972, Caliban’s Day offers insights into the characters of two gay artists who had once been friends and collaborators. A richer, deeper and hugely more amusing drama is created by means of the framing device, which allows all involved in the play within the play to to comment on and question the action, often with hilarious results.

These interventions sometimes have the useful function of answering criticisms that are likely to occur to members of the audience. If we think it odd, for instance, that the famously bulky Griffiths should be playing the gangly Auden, we find Neil thinking the same about Fitz.

The matter is dealt with by stage manager Kay, brilliantly played by Frances de la Tour who is well practised at keeping her “preciouses” from falling out. “I agree he’s a bit on the big side, but this is theatre, darling. Stephen [the absent director] wants to get away from facile resemblance in favour of the reality beneath.” (From her lips come many such observations about the stage – a major theme of the play.) Some might think, too, that the seedy side to Auden’s life is too much stressed, with his urinating in the basin of his Christ Church cottage and the ordering up of a rent boy (excellently played by Stephen Wight) to visit him there. Carpenter is hilariously mistaken for him in the first instance and invited to take off his trousers: “I am not a rent boy,” he complains. “I was at Keble.”

Fitz takes this view, too – especially where Auden’s graphic descriptions of genitalia and sex acts are concerned – and he (we) gets the answer from the author: “The words are his not mine. ‘The facts of a life are the truth of a life.’ He’s human. He’s old”.

If the play has a fault, it is that Britten remains throughout something of a shadowy figure, perhaps because he was rather hard to fathom. No punches are pulled, though, over his dubious attitude to pre-pubescent boys. “You like boys, Ben,” Auden tells him. “Dionysus for you comes in a grey flannel suit or cricket whites.”

Where the creative impulse is concerned Bennett is seen to be considerably more insightful about Auden, perhaps because of his greater understanding of the mind of a fellow writer. He certainly knew what kept him grafting: “I have the habit of art,” he tells Britten. “I have to work or else who am I?”

Witty, wise and wonderfully directed by Nicholas Hytner, this is a play not to miss.

Lyttelton Theatre, until April 6, day tickets and returns only. Further tickets for later dates to be issued mid-February. Tel: 020 7452 3000 (www.nationaltheatre.org.uk).