XMM–Newton observations of ultraluminous X–ray sources in nearby galaxies