XUpdateProcessor proc = new XUpdateProcessor();
XUpdateProcessor proc = new XUpdateProcessor(broker, docs);
    public void testUpdate() throws Exception {        BrokerPool.FORCE_CORRUPTION = true;        BrokerPool pool = startDB();                DBBroker broker = null;        try {            broker = pool.get(SecurityManager.SYSTEM_USER);                        TransactionManager mgr = pool.getTransactionManager();                        IndexInfo info = init(broker, mgr);            DocumentSet docs = new DocumentSet();            docs.add(info.getDocument());            XUpdateProcessor proc = new XUpdateProcessor();                        Txn transaction = mgr.beginTransaction();                        String xupdate;            Modification modifications[];                        // append some new element to records            for (int i = 1; i <= 50; i++) {                xupdate =                    "<xu:modifications version=\"1.0\" xmlns:xu=\"http://www.xmldb.org/xupdate\">" +                    "   <xu:append select=\"/products\">" +                    "       <product>" +                    "           <xu:attribute name=\"id\"><xu:value-of select=\"count(/products/product) + 1\"/></xu:attribute>" +                    "           <description>Product " + i + "</description>" +                    "           <price>" + (i * 2.5) + "</price>" +                    "           <stock>" + (i * 10) + "</stock>" +                    "       </product>" +                    "   </xu:append>" +                    "</xu:modifications>";                proc.setBroker(broker);                proc.setDocumentSet(docs);                modifications = proc.parse(new InputSource(new StringReader(xupdate)));                modifications[0].process(transaction);                proc.reset();            }                        mgr.commit(transaction);                        Serializer serializer = broker.getSerializer();            serializer.reset();                        DocumentImpl doc;            String data;                        doc = broker.openDocument("/db/test/test2/test.xml", Lock.READ_LOCK);            assertNotNull("Document /db/test/test2/test.xml should not be null", doc);            data = serializer.serialize(doc);            System.out.println(data);            doc.getUpdateLock().release(Lock.READ_LOCK);                        // the following transaction will not be committed and thus undone during recovery            transaction = mgr.beginTransaction();                        // remove elements            for (int i = 1; i <= 25; i++) {                xupdate =                    "<xu:modifications version=\"1.0\" xmlns:xu=\"http://www.xmldb.org/xupdate\">" +                    "   <xu:remove select=\"/products/product[last()]\"/>" +                    "</xu:modifications>";                proc.setBroker(broker);                proc.setDocumentSet(docs);                modifications = proc.parse(new InputSource(new StringReader(xupdate)));                modifications[0].process(transaction);                proc.reset();            }            pool.getTransactionManager().getJournal().flushToLog(true);        } finally {            pool.release(broker);        }    }