<?xml version="1.0"?> 
<xupdate:modifications version="1.0" xmlns:xupdate="http://www.xmldb.org/xupdate">
<xupdate:append select="/"  child="first()" >  <xupdate:element name="a">ii
  </xupdate:element>
</xupdate:append>

<xupdate:rename select="/a[2]" >b</xupdate:rename>

<xupdate:remove select="/b[1]" />

<xupdate:insert-after select="/a[1]/text()[1]" >  <xupdate:element name="b">moretext
  </xupdate:element>
</xupdate:insert-after>

<xupdate:remove select="/a[1]/b[1]/b[1]" />

</xupdate:modifications>