Electromagnetic breakup of three- and four-body nuclei