Thank you for your help it's getting me well going.

I have the following program of which AddDocument() and ReadDocument() are working OK but when I get into UpdateDocument() I am having the following error:
		Query Processing error
		from:
		long count = service.update(xupdate);		/* error from here */
The items I am trying to update are valid, when I willingly use wrong elements it really sees that there are no items to update.
Can you help.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;
import org.w3c.dom.*;

public class XindiceServlet7 extends HttpServlet {
	Collection col = null;
         String driver;
         Class c;
         PrintWriter out;         
         Database database;

    // The method corresponding to HTTP GET
    public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
         col = null;
         out = response.getWriter();
            try {
                driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
                c = Class.forName(driver);    
         
                 database = (Database) c.newInstance();
                 DatabaseManager.registerDatabase(database);
                 col =
	         DatabaseManager.getCollection("xmldb:xindice:///db/addressbook");

		AddDocument("D:/Xindice/build.xml", "ali");
            } catch(Exception e) {
                out.write("<error value='" + e.getMessage() + "'/>");
            }
            finally {
            }
      }
	
	public void AddDocument(String name, String id) throws Exception{
	        String data = readFileFromDisk(name);
      
      	   	XMLResource document = (XMLResource) col.createResource(null, "XMLResource");
         	document.setContent(data);
         	col.storeResource(document);
		ReadDocument(document.getId());
	}

	public void ReadDocument(String name) throws Exception {
		XMLResource document = (XMLResource) col.getResource(name);
         	if (document != null) {
            		out.println(document.getContent());
         	}
         	else {
            		out.println("Document not found");
         	}
		UpdateDocument();
	}
	public void UpdateDocument() throws Exception {
	       String xupdate = "<xu:modifications version=\"1.0\"" +
            	"      xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
            	"   <xu:update select=\"/person/phone[@type = 'work']\">" +
            	"       480-300-3003" +
            	"   </xu:update>" +
            	"</xu:modifications>";

	        XUpdateQueryService service =
        	    (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
         	long count = service.update(xupdate);		/* error from here */
         	out.println("<error value='" + count + "'/>");
  	}
	public static String readFileFromDisk(String fileName) throws Exception {
		File file = new File(fileName);
      		FileInputStream insr = new FileInputStream(file);
                  
      		byte[] fileBuffer = new byte[(int)file.length()];
   
      		insr.read(fileBuffer);
      		insr.close();
      
      		return new String(fileBuffer);
   	}

}
