protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String xquery = "<xml>{ for $cedar in  collection('CED2AR') return ";
		String[] query  = request.getParameter("query").split(" ");
		for(int i = 0; i < query.length; i++){
			if(i == 0){
				xquery += "$cedar/codeBook/dataDscr/var[contains(labl, '"+query[i]+"')";
			}
			else{
				xquery += " and contains(labl, '"+query[i]+"')";
			}

		
		}
		
		xquery += "]}</xml>";
		String xml = Functions.getXML(xquery);
		PrintWriter out = response.getWriter();
		
		//out.write(xquery);
		
		try {
			DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
			DocumentBuilder db = dbf.newDocumentBuilder();
			InputSource is = new InputSource();
			is.setCharacterStream(new StringReader(xml));

			Document doc = db.parse(is);

			NodeList variableNames = doc.getElementsByTagName("var");
			out.print("<table class=\"codebookTable\">");
			for (int i = 0; i < variableNames.getLength(); i++) {
				out.print("<tr>");
				Element element = (Element) variableNames.item(i);
				out.print("<td class=\"tdLeft\"><a href=\"SimpleSearchViewVariable?variableName=" + element.getAttributes().getNamedItem("name").getNodeValue() + "&codebook=ACS2009G\" class=\"variableName\">" + element.getAttributes().getNamedItem("name").getNodeValue() + "</a></td>");
				try { NodeList label = element.getElementsByTagName("labl");
					  out.print("<td class=\"tdRight\">" + label.item(0).getFirstChild().getNodeValue() + "</td>"); 
					  out.print("</tr>"); }
				catch (NullPointerException ne){ out.print("<td class=\"tdRight\"></td>");
												 out.print("</tr>");}
			}
			out.print("</table>");
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		out.close();
	}