Theory of soliton pulse forming in an actively modelocked fiber laser