“Elf” joins the ranks of amusing contemporary Christmas comedies oriented to the family trade, in the tradition of “The Santa Clause.” It surprises me to be writing these words, since it stars Will Ferrell, who’s always rather creeped me out, and the thought of watching him prance about in tights and peaked cap for ninety minutes was not an inviting prospect. In the event, though, the “Saturday Night Live” star purges his familiar naughty-child character of the Freudian potty-minded, lascivious quality it usually carries and transforms himself into somebody more innocent and harmless–a nice fit with this sort of blandly humorous holiday fluff. While “Elf” is no instant classic, it’s a cheerfully inoffensive cinematic bauble that may be no more durable than a tree ornament but should charm the parents and kids who will flock to it, probably for multiple viewings.

First-timer David Barenbaum’s script is basically a yuletide-themed variant of “The Jerk,” in which Steve Martin played a clueless white guy brought up in an African-American family who goes out to make his way, with supreme clumsiness, in the world. Here Ferrell plays Buddy, who as an orphaned urchin climbed into Santa’s (Ed Asner’s) sack, was carried back to the North Pole, and was adopted and raised by a childless elf (Bob Newhart) as his own son. Three decades later, Buddy has grown to over six feet and possesses no elfish talents, but is too much a doofus to realize he’s actually a human until he overhears his diminutive colleagues talking about it. Once apprised of the truth, Buddy sets out to find the father who never knew of his birth–Walter (James Caan), a cynical children’s book publisher who initially looks upon the loping, strangely dressed fellow as an obvious nut case. Eventually medical tests prove paternity, however, and soon Buddy has joined Walter’s understanding wife (Mary Steenburgen) and neglected son (Daniel Tay) in their Manhattan apartment. Wouldn’t you know that over the pre-Christmas period Buddy breaks through Walter’s crusty exterior and finds the warmth inside? And that at the close, when Santa is in need of help on December 24, it’s Buddy, like Rudolf the reindeer, who–along with his newly-found family and Jovie (Zooey Deschanel), the girlfriend he’s met while briefly working at Gimbel’s–saves the day by reigniting the spirit of the holiday in all those jaded New Yorkers?

Clearly “Elf” isn’t a terribly sophisticated or innovative piece, and it’s a scattershot one as well, depending on throwaway gags and mini-sketches rather than a real story arc. And some of the bits don’t work particularly well–the whole subplot involving Buddy’s stint at Gimbel’s and his gradually winning over of Jovie, in fact, never quite jells (an episode in which Buddy tussles with the store Santa is especially bad), and the entire concluding episode in Central Park, with its posse of mounted cops and its heart-tugging renditions of Christmas carols, comes across as a rather desperate effort to create a big finale. But Ferrell manages to pull off a lot of them, even when they’re pretty weak stuff–Buddy getting a charge out of a revolving door or surreptitiously chewing gum that’s been stuck on subway rails, or almost crushing poor Papa Elf when sitting on his lap. (There are also some goofy animated North Pole figures–including a know-it-all snowman–that garner more laughs than one has any right to expect.) A few moments that have absolutely nothing to do with the basic story come out of the blue and work like great cadenzas, too; one that stands out is an episode involving Peter Dinklage (of “The Station Agent”) as an arrogant children’s book author who’s very sensitive about his size.

And though the material is variable, the cast and crew consistently give it their best. Ferrell maintains a proper air of childish likableness, and Caan one of comic irascibility. Old pros Newhart and Asner bring their considerable skill to the table, and Steenburgen and Tay are both engaging, adding a nice note of warmth to the domestic proceedings. If Deschanel comes across as rather anonymous in this company, it’s the fault of the writing rather than the actress. Actor Jon Favreau directs without much elegance but with sufficient verve, and also pops in for a cameo as Walter’s doctor. Technically the picture is fine, with the North Pole sequences standing out as especially vivid and colorful.

As with so many holiday-themed movies, “Elf” sometimes goes squishily sentimental, especially toward the close, when its assault on the tear ducts crosses the line. For the most part, however, it exudes a sweetness that isn’t cloying, and brings plenty of smiles and laughs along the way. It should spread a lot of holiday cheer and enjoy a long video life as a Christmas perennial.