Sweden has charged two men of Somali descent with planning terrorist attacks in Somalia .