[PATCH 02/23] virInsertElementsN: Split out actual insertion code