# fn:insert-before - XPath XQuery Reference

Returns a sequence constructed by inserting an item or a sequence of items at a given
            position within an existing sequence.deterministiccontext-independentfocus-independentThe value returned by the function consists of all items of $target whose
            index is less than $position, followed by all items of
               $inserts, followed by the remaining elements of $target, in
            that order. fn:insert-before($abc, 0, "z")("z", "a", "b", "c")fn:insert-before($abc, 1, "z")("z", "a", "b", "c")fn:insert-before($abc, 2, "z")("a", "z", "b", "c")fn:insert-before($abc, 3, "z")("a", "b", "z", "c")fn:insert-before($abc, 4, "z")("a", "b", "c", "z")If $target is the empty sequence, $inserts is returned. If
               $inserts is the empty sequence, $target is returned.If $position is less than one (1), the first position, the effective value
            of $position is one (1). If $position is greater than the
            number of items in $target, then the effective value of
               $position is equal to the number of items in $target plus
            1. The value of $target is not affected by the sequence construction.