https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_insert_Element
The text for the insert element is two pages of fairly opaque text, which I have recently thought about a lot trying to make it more digestible.
=====
The target-sequence is obtained from the element evaluation context.
The origin-sequence is obtained
the nodes of the origin-sequence are added one by one to the context element
the last element of the target-sequence is copied, and added to the target sequence
the origin-sequence is obtained
the nodes are added one by one to the target sequence.
An origin sequence is obtained by evaluating the origin attribute in the in-scope evaluation context, and removing any root nodes (parents of document elements) from the resulting sequence. An implementation may choose not to include namespace nodes in the origin-sequence, in particular if the namespace axis is not supported or if inserting the namespace node would make the data model inconsistent.
An element is added to a sequence:
by inserting the element at the appropriate sort position in the sequence
by inserting the element according to the at and
position values:
it is evaluated as a number in the Element Evaluation Context and
rounded to the nearest integer;
if the result is not a number, is less than 1 or is greater than the
target-sequence size: the insert action has no effect.