Use Domain::insertelement. Remove deprecated Domain::setItem().

Fixes #154.