Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraSearch.java.tmp
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraSearch.java.tmp	(revision 28968)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraSearch.java.tmp	(revision 28969)
@@ -69,4 +69,5 @@
     public FedoraSearch()
     {
+      QUERY_SERVICE = "TextQuery";
     }
     
@@ -86,7 +87,7 @@
 	    return false;
 	}
-	Element tq_service = this.doc.createElement(GSXML.SERVICE_ELEM);
+	Element tq_service = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
 	tq_service.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_QUERY);
-	tq_service.setAttribute(GSXML.NAME_ATT, TEXT_QUERY_SERVICE);
+	tq_service.setAttribute(GSXML.NAME_ATT, QUERY_SERVICE);
 	this.short_service_info.appendChild(tq_service);
 	//does_paging = true;
@@ -96,5 +97,5 @@
 	Element format = (Element) GSXML.getNodeByPath(extra_info, path);
 	if (format != null) {
-	    this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(format, true));
+	    this.format_info_map.put(QUERY_SERVICE, this.desc_doc.importNode(format, true));
 	}
 	return true;
@@ -104,9 +105,10 @@
     protected Element processTextQuery(Element request) {
 	// Create a new (empty) result message
-	Element result = this.doc.createElement(GSXML.RESPONSE_ELEM);
-	result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE);
+	Document result_doc = XMLConverter.newDOM();
+	Element result = result_doc.createElement(GSXML.RESPONSE_ELEM);
+	result.setAttribute(GSXML.FROM_ATT, QUERY_SERVICE);
 	result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
 	
-	Element doc_node_list = this.doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER);
+	Element doc_node_list = result_doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER);
 	result.appendChild(doc_node_list);
 	
@@ -178,8 +180,8 @@
 		    String[] language = o.getLanguage();
 
-		    Element doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM);
+		    Element doc_node = result_doc.createElement(GSXML.DOC_NODE_ELEM);
 		    doc_node_list.appendChild(doc_node);
 		    
-		    Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
+		    Element metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
 		    doc_node.appendChild(metadata_list);
 		    
@@ -206,5 +208,5 @@
 	}
     	
-	Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
+	Element metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
 	result.appendChild(metadata_list);
 	
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleSearch.java.tmp
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleSearch.java.tmp	(revision 28968)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleSearch.java.tmp	(revision 28969)
@@ -36,5 +36,4 @@
 /**
  *
- * @author <a href="mailto:chi@cs.waikato.ac.nz">Chi-Yu Huang</a>
  *
  */
@@ -57,4 +56,5 @@
     public GoogleSearch()
     {
+      QUERY_SERVICE = "TextQuery";
     }
 	    
@@ -120,10 +120,11 @@
 	
 	// Create a new (empty) result message
-	Element result = this.doc.createElement(GSXML.RESPONSE_ELEM);
-	result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE);
+	Document result_doc = XMLConverter.newDOM();
+	Element result = result_doc.createElement(GSXML.RESPONSE_ELEM);
+	result.setAttribute(GSXML.FROM_ATT, QUERY_SERVICE);
 	result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
-	Element doc_node_list = this.doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER);
+	Element doc_node_list = result_doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER);
 	result.appendChild(doc_node_list);
-	Element query_metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
+	Element query_metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
 	result.appendChild(query_metadata_list);
 
@@ -200,8 +201,8 @@
 	    GoogleSearchResultElement[] details = google_result.getResultElements();
 	    for (int i=0; i<details.length; i++){
-		Element doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM);
+		Element doc_node = result_doc.createElement(GSXML.DOC_NODE_ELEM);
 		doc_node_list.appendChild(doc_node);
 		
-		Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
+		Element metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
 		doc_node.appendChild(metadata_list);
 		
