Edit online

fragment
The XML fragment that will surround the selection. For example, consider the fragment:
<F>
   <A></A>
   <B>
     <C></C>
   </B>
</F>
and the document:
<doc>
  <X></X>
  <Y></Y>
  <Z></Z>
<doc>
Considering the selected content to be surrounded is the sequence of elements X and Y, then the result is:
<doc>
   <F>
      <A>
         <X></X>
         <Y></Y>
      </A>
      <B>
        <C></C>
      </B>
   </F> 
  <Z></Z>
<doc>

Since the element A was the first leaf in the fragment, it received the selected content. The fragment was then inserted in the place of the selection.

schemaAware
This argument applies only on the surround with element operation and controls whether or not the insertion is valid, based upon the schema. If the insertion is not valid, then wrapping action will be broken up into smaller intervals until the wrapping action is valid. For example, if you try to wrap a paragraph element with a bold element, it would not be valid, so the operation will wrap the text inside the paragraph instead, since it would be valid at that position.