<?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">    <b>
moretext
    </b>
  </xupdate:element>
</xupdate:append>

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

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

<xupdate:append select="/a[1]" >  <xupdate:element name="branch">ii
    <new>
hehe
    </new>
  </xupdate:element>
</xupdate:append>

<xupdate:append select="/a[1]/branch[1]"  child="first()" >  <xupdate:text>ii</xupdate:text>
</xupdate:append>

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

</xupdate:modifications>