What to do with children born to women serving time is a social dilemma that tests even the most advanced prison regimes.
By Duncan Kennedy
BBC News, Mexico
In Mexico, the authorities believe they are starting to deal with the problem head on, with some dramatic results.
They have started allowing babies born in jail to stay with their mothers until they are six years old.
Compare that to England or Scotland, where typically mothers can only keep their babies until they are 18 months old, and then only in exceptional circumstances.
Or Canada, where historically children have only been allowed to stay until they are around three years old.
Sweden has traditionally taken an even more restrictive view, not allowing any children to stay in jail, arguing prison is not the place for them.
In part it is because these countries have unsuitable jails that were not designed to house children, but there is also a view that women should forfeit their rights when they are convicted, including those of parenting.
Countries such as Bolivia and India do allow children to stay with their mothers until a similar age to those in Mexico, but the difference with the Mexican experience is the time and effort is devoted to the mothers as well.
'Less likely to return'
A prime example of this shift is the programme now under way at one of Mexico's toughest women's jails.
Among the 1600 inmates at the Santa Martha prison in Mexico City you will find murderers, kidnappers and drug dealers. You will also find about 40 to 50 children.
In a programme run by Elsa Romero, they have created a mini world within the prison to keep mothers and their children together.
"The children get to stay with their mothers longer and so are able to avoid the emotional damage done by separation, whilst the mothers are taught how to take on more responsibility," Ms Romero explains. "Everyone wins."
Ms Romero and her team believe that for women who keep their children longer, the rate of re-offending falls to about 10%, while for women who don't keep their children it is about 30%.
The children attend school just like any others
"Without my child I have no purpose, no reason", one of the mothers in the prisons nursery says.
Maria is serving 27 years and six months for murder. "I regret that every day", she says, "but it would be an unbearable sentence without my son".
Learning to nurture
Her fellow inmate Idalia shares that view. In between her tears she manages to tell me that the scheme to keep children until they are six makes her sentence and her life more tolerable.
"Prison might not be the perfect place for my child," she says. "But without him I know I wouldn't have lasted. And I won't be back."
In institutions where the children are taken away many of the mothers have been known to harm themselves.
In Santa Martha, as well as having a much longer period to develop their sense of responsibility, the women are also taught how to respect their child, to monitor their development, to nurture them.
Ms Romero says the children are spared the trauma of separation
They are taught the skills so often lacking among the poor, uneducated women, that end up in jails like this.
The children seem to thrive too.
In one classroom a group of four-year-olds are learning Spanish - the sounds of "ca" and "sa" fill the room, as each child practices the Spanish word for house, casa.
"They are normal," says their teacher, Claudia. "They are no different."
No different, apart from having a female guard at the door and bars on their classroom window.
Lupita, another of the mothers, admits that prison is not the best environment for a child: "You see violence, drugs, everything here," she says. "Children are better off outside."
But even she is adamant that her daughter should stay: "I couldn't stand being parted from her," she says.