You should use the MoveToXXX methods to move the document builder's cursor to a particular place or element in the document in order to insert the necessary elements there.