StringWriter out = new StringWriter(); out.write("<test>"); for(int i = 1; i <= ITEM_COUNT; i++) { createItem(i, out); } out.write("</test>"); String data = out.toString(); DBUtils.addXMLResource(testCol, "test.xml", data);
DBUtils.addXMLResource(testCol, "test.xml", "<test/>");
    protected void setUp() throws Exception {        rootCol = DBUtils.setupDB(URI);                testCol = rootCol.getChildCollection("/db/test");        if(testCol != null) {            CollectionManagementService mgr = DBUtils.getCollectionManagementService(rootCol);            mgr.removeCollection("/db/test");        }                testCol = DBUtils.addCollection(rootCol, "test");        assertNotNull(testCol);                StringWriter out = new StringWriter();        out.write("<test>");        for(int i = 1; i <= ITEM_COUNT; i++) {            createItem(i, out);        }        out.write("</test>");        String data = out.toString();        DBUtils.addXMLResource(testCol, "test.xml", data);    }