Index: lib/style/skins/sanparks/searchPathQuery.js
===================================================================
--- lib/style/skins/sanparks/searchPathQuery.js	(revision 7677)
+++ lib/style/skins/sanparks/searchPathQuery.js	(revision 7678)
@@ -1,4 +1,14 @@
+function encodeXML(theString) {
+	return theString.replace(/&/g, '&amp;')
+		.replace(/</g, '&lt;')
+		.replace(/>/g, '&gt;')
+		.replace(/"/g, '&quot;');
+}
+
 function generateQueryString(organizationScope, anyValue, searchFields) {
+	// make sure it is valid XML
+	var searchTerm = encodeXML(anyValue);
+	
 	var queryString = ""; 
 	queryString += "<pathquery version='1.2'>";
 	queryString += "<returndoctype>metadata</returndoctype>";
@@ -31,7 +41,7 @@
 		queryString += "<querygroup operator='UNION'>";
 		for (var i = 0; i < searchFields.length; i++) {
 			queryString += "<queryterm casesensitive='false' searchmode='contains'>";
-			queryString += "<value>" + anyValue + "</value>";
+			queryString += "<value>" + searchTerm + "</value>";
 			queryString += "<pathexpr>" + searchFields[i] +"</pathexpr>";
 			queryString += "</queryterm>";
 		}
@@ -39,7 +49,7 @@
 	}
 	else {
 		queryString += "<queryterm casesensitive='false' searchmode='contains'>";
-		queryString += "<value>" + anyValue + "</value>";
+		queryString += "<value>" + searchTerm + "</value>";
 		queryString += "</queryterm>";
 	}
 	
Index: lib/style/skins/parc/search.js
===================================================================
--- lib/style/skins/parc/search.js	(revision 7677)
+++ lib/style/skins/parc/search.js	(revision 7678)
@@ -1,3 +1,10 @@
+function encodeXML(theString) {
+	return theString.replace(/&/g, '&amp;')
+		.replace(/</g, '&lt;')
+		.replace(/>/g, '&gt;')
+		.replace(/"/g, '&quot;');
+}
+
 function trim(stringToTrim) {
     return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
 }
@@ -4,6 +11,7 @@
 
 function checkSearch(submitFormObj) {
     var searchString = trim(submitFormObj.searchstring.value);
+	searchString = encodeXML(searchString);
     var checkBox = document.getElementById("searchAll");
 
     if (searchString=="") {
Index: lib/style/skins/obfs/index.jsp
===================================================================
--- lib/style/skins/obfs/index.jsp	(revision 7677)
+++ lib/style/skins/obfs/index.jsp	(revision 7678)
@@ -44,13 +44,21 @@
           src="<%=STYLE_COMMON_URL%>/branding.js"></script>
   <script language="Javascript">
 
+		function encodeXML(theString) {
+			return theString.replace(/&/g, '&amp;')
+				.replace(/</g, '&lt;')
+				.replace(/>/g, '&gt;')
+				.replace(/"/g, '&quot;');
+		}
+		
         function trim(stringToTrim) {
                 return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
         }
 
         function checkSearch(submitFormObj) {
-                var searchString = trim(submitFormObj.searchstring.value);
-		var checkBox = document.getElementById("searchAll");
+        	var searchString = trim(submitFormObj.searchstring.value);
+    		searchString = encodeXML(searchString);
+			var checkBox = document.getElementById("searchAll");
 
                 if (searchString=="") {
                        if (confirm("Show *all* data?")) {
Index: lib/style/skins/nrs/index.jsp
===================================================================
--- lib/style/skins/nrs/index.jsp	(revision 7677)
+++ lib/style/skins/nrs/index.jsp	(revision 7678)
@@ -44,12 +44,20 @@
           src="<%=STYLE_COMMON_URL%>/branding.js"></script>
   <script language="Javascript">
 
+		function encodeXML(theString) {
+			return theString.replace(/&/g, '&amp;')
+				.replace(/</g, '&lt;')
+				.replace(/>/g, '&gt;')
+				.replace(/"/g, '&quot;');
+		}
+  
         function trim(stringToTrim) {
                 return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
         }
 
         function checkSearch(submitFormObj) {
-                var searchString = trim(submitFormObj.searchstring.value);
+		var searchString = trim(submitFormObj.searchstring.value);
+		searchString = encodeXML(searchString);
 		var checkBox = document.getElementById("searchAll");
 
                 if (searchString=="") {
Index: lib/style/skins/saeon/searchPathQuery.js
===================================================================
--- lib/style/skins/saeon/searchPathQuery.js	(revision 7677)
+++ lib/style/skins/saeon/searchPathQuery.js	(revision 7678)
@@ -1,4 +1,14 @@
+function encodeXML(theString) {
+	return theString.replace(/&/g, '&amp;')
+		.replace(/</g, '&lt;')
+		.replace(/>/g, '&gt;')
+		.replace(/"/g, '&quot;');
+}
+
 function generateQueryString(organizationScope, anyValue, searchFields) {
+	// make sure it is valid XML
+	var searchTerm = encodeXML(anyValue);
+	
 	var queryString = ""; 
 	queryString += "<pathquery version='1.2'>";
 	queryString += "<returndoctype>metadata</returndoctype>";
@@ -31,7 +41,7 @@
 		queryString += "<querygroup operator='UNION'>";
 		for (var i = 0; i < searchFields.length; i++) {
 			queryString += "<queryterm casesensitive='false' searchmode='contains'>";
-			queryString += "<value>" + anyValue + "</value>";
+			queryString += "<value>" + searchTerm + "</value>";
 			queryString += "<pathexpr>" + searchFields[i] +"</pathexpr>";
 			queryString += "</queryterm>";
 		}
@@ -39,7 +49,7 @@
 	}
 	else {
 		queryString += "<queryterm casesensitive='false' searchmode='contains'>";
-		queryString += "<value>" + anyValue + "</value>";
+		queryString += "<value>" + searchTerm + "</value>";
 		queryString += "</queryterm>";
 	}
 	
Index: lib/style/skins/esa/index.jsp
===================================================================
--- lib/style/skins/esa/index.jsp	(revision 7677)
+++ lib/style/skins/esa/index.jsp	(revision 7678)
@@ -49,6 +49,12 @@
           src="<%=STYLE_COMMON_URL%>/branding.js"></script>
   <script language="Javascript">
 
+  function encodeXML(theString) {
+		return theString.replace(/&/g, '&amp;')
+			.replace(/</g, '&lt;')
+			.replace(/>/g, '&gt;')
+			.replace(/"/g, '&quot;');
+	}
 	function trim(stringToTrim) {
                 return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
         }
@@ -57,7 +63,8 @@
                 var checkBox = document.getElementById("searchCheckBox");
                 var searchBox = document.getElementById("searchBox");
                 var searchString = trim(searchBox.value);
-
+                searchString = encodeXML(searchString);
+                
                 if (searchString=="") {
                         searchString="%";
                 }
