From Ancestry.com Wiki
Shirley is a town in Massachusetts. It was formed in 1753 and was previously called Groton. It can be found in Middlesex county and is a part of the Southern registry of deed district. For more information, contact the county at 7 Keady Way, Shirley 01464. On the attached map, Shirley is shown as 9 in Middlesex county.
For information about the state of Massachusetts see Massachusetts Family History Research.