out.write("<xu:insert-before select=\"/test/item[@id='"); out.write(Integer.toString(id)); out.write("']\">"); createItem(5, out); out.write("</xu:insert-before>");
out.write("<xu:append select=\"/test\">"); createItem(id, out); out.write("</xu:append>");
    protected void append(XUpdateQueryService service, int id) throws Exception {        StringWriter out = new StringWriter();        out.write("<xu:modifications xmlns:xu=\"http://www.xmldb.org/xupdate\" version=\"1.0\">");        out.write("<xu:insert-before select=\"/test/item[@id='");        out.write(Integer.toString(id));        out.write("']\">");        createItem(5, out);        out.write("</xu:insert-before>");        out.write("</xu:modifications>");         long mods = service.update(out.toString());         assertEquals(mods, 1);    }