Americans are famously generous when it comes to helping those in need. One such chapter in our history was an effort to place thousands of homeless and orphaned children from New York into rural homes in the Midwest.

From the mid-1800s through the 1920s, the Children’s Aid Society rounded up such kids, shuttled them to the heartland and paraded them on stages along the train route, where would-be foster parents picked over them like so much merchandise.

Christina Baker Kline has taken a page from this troubled history and given it a fresh spin. Her novel, “Orphan Train,” follows one child’s odyssey from Ireland to New York to Minnesota to Maine.

Kline navigates deftly between present and past, between a young person’s narration of events and an elder’s view looking back.

The result is an eloquent, bittersweet story of survival and loss, with charm and humor to spare.

Kline has created two singularly disarming characters — 91-year-old Vivian Daly, a canny and resourceful widow who lives in a Spruce Harbor mansion, and 17-year-old Molly Ayer, a goth with a skunk-stripe in her hair who was recently caught stealing “Jane Eyre” from the library.

What brings these two together is the community service project that Molly must perform as punishment for her theft and Vivian’s wish to clean out a lifetime of boxes in her attic. Their improbable pairing will prove to be a natural.

Some 80 years ago, 9-year-old Vivian and her family left Ireland for the promise of America. But a fire in their New York apartment wiped out her family, leaving Vivian grief-stricken and alone. Soon she would become an orphan train rider, seeking a new family and home.

Molly, by contrast, is a nine-year veteran of Maine’s foster care system. The daughter of a drug addict and an alcoholic, she has lived in more than a dozen homes, some for only a week. As we learn in alternating chapters, the sagas of these two disparate characters overlap in countless, unsettling ways.

As they begin to sort through the boxes in Vivian’s attic, it becomes clear that Vivian won’t easily part with their contents. She’ll hold up fragments of her broken childhood – an old sewing kit, a girl’s coat or dress – and return the items to their box.

Some are keepsakes from the few grown-ups who looked out for her in otherwise squalid, untenable homes; others suggest her improving fortunes as she grew up.

The ongoing attic purge and, later, an assignment in Molly’s history class are the devices that allow Kline to interweave the two characters and their personal narratives.

So we learn about the shared terrain of their lives in foster care – the shifting names and identities that come with new families; the vulnerability to other people’s whims; the chronic distrust of people’s motives.

Nor do these women ever stop longing for their original families.

“Vivian has come back to the idea that the people who matter in our lives stay with us, haunting our most ordinary moments,” Kline writes. “They’re with us in the grocery store, as we turn a corner, chat with a friend. They rise up through the pavement; we absorb them through our soles.”

There are times when the particulars of Vivian’s Depresson-era childhood seem relentlessly grim. Among the abuses, she’s forced to work without pay, forbidden to attend school and molested by one of her foster parents.

Yet Kline’s lively portrayals of Vivian and Molly save the day. Despite all odds, these are two sturdy, clear-eyed women who continue to surprise each other – and us.

In the end, what begins as punishment for a troubled teen blooms into a mutually valued friendship.

Lots of attitude, from all sides, keeps the heartbreak quotient within reason.

Above all, Vivian’s journey will stay with readers long after the final page.

Joan Silverman of Kennebunk writes op-eds, essays and book reviews for numerous publications.