Formation of S=−2 hypernuclei