Martha Stewart's (search) recipe for doing hard time in prison: whip up something sweet with crab apples.

The guru of good living spent some time last week picking crab apples (search) from trees that dot the grounds of her federal lockup in West Virginia — and used them to make a tasty dish.

"The normal person would get punished for that, but the prison guards managed not to see her," an inmate told The Post. "She might not have known it was wrong, but other inmates have advised her not to do that anymore, and I don't think she has."

While the inmate didn't know the exact dish Stewart whipped up with the pilfered produce, she could have used the hot goods to make her famous crab apple rosemary jelly (search).

Dawn Zobel, a spokeswoman at the Federal Prison Camp in rural Alderson, W.Va., said she was unaware Stewart was picking fruit, although she said it is unlikely that a prisoner would get into serious trouble for such activity. "It's a 105-acre compound with a lot of different trees and crab apples are amongst them," she said. "If an inmate was seen picking them, we would probably have an informal discussion with them.

"I don't have enough agriculture savvy to say that it's appropriate for them to eat. I'm sure they are not sprayed or appropriately treated, so we would want to discourage that activity."

Stewart once wrote in a column that crab apples' "texture and flavor make them excellent for preserves, chutneys, jams and jellies."

"Those lucky enough to have crab apple trees not only enjoy beautiful early-spring blooms but an abundance of fruit each fall," she wrote. "Smaller, harder and considerably tarter than other apples, crab apples are edible, though they are not good snacking apples."

A friend of the inmate told The Post he personally got to meet Stewart Sunday while visiting the prison. He said many of the other visitors treated Stewart like a celebrity and that she took time to speak with everyone who greeted her.

The friend said Martha's daughter, Alexis, visited her mother alone and that the two spent much of the morning playing Scrabble.

Stewart, 63, began serving a five-month sentence on Oct. 8 after being found guilty of obstruction of justice. A jury determined that she lied to authorities about events surrounding her 2001 sale of stock in the firm ImClone just before its price plunged. The inmate also said that Stewart's lawyers visited her several times last week during non-visitation hours.

Zobel said she could not comment on any inmate's lawyers but that the prison prefers having lawyers visit their locked-up clients during non-visitation days.