Final answer:
Mary is demonstrating generativity, as per Erikson's psychosocial theory, by volunteering at a homeless shelter to contribute to others' well-being during her middle adulthood stage.
Step-by-step explanation:
According to Erikson's psychosocial theory, Mary is demonstrating generativity. In middle adulthood, which ranges from the 40s to mid-60s, an individual is said to be in the generativity versus stagnation stage. Generativity involves engaging in activities that contribute to the wellbeing of the next generation, such as through mentoring, volunteering, or raising children. In Mary's case, her involvement in a homeless shelter for women and children exemplifies a strong sense of generativity, whereby she contributes to the development of others and finds meaning in these connections beyond her personal challenges of being unable to have children.