public void addindex(urlinfo urlinfo, String location) {

		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		DocumentBuilder docBuilder;
		try {
			docBuilder = dbf.newDocumentBuilder();

			Document doc = docBuilder.parse(location);
			doc.normalize();

			Element urlinfomation = doc.createElement("urlinfo");

			doc.getDocumentElement().appendChild(urlinfomation);
			Element urlid = doc.createElement("urlid");

			urlinfomation.appendChild(urlid);
			urlid.appendChild(doc.createTextNode(Integer.toString(urlinfo
					.getUrlid())));

			Element url = doc.createElement("url");
			urlinfomation.appendChild(url);
			url.appendChild(doc.createTextNode(urlinfo.getUrl()));

			Element descritption = doc.createElement("description");
			urlinfomation.appendChild(descritption);
			descritption.appendChild(doc.createTextNode(urlinfo
					.getDescription()));

			TransformerFactory tf = TransformerFactory.newInstance();
			Transformer transformer = tf.newTransformer();
			DOMSource source = new DOMSource(doc);
			//	        Result resultStr = new StreamResult(writerStr);  

			StreamResult xmlResult = new StreamResult(
					new java.io.File(location));
			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
			transformer.transform(source, xmlResult);
		} catch (ParserConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SAXException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerConfigurationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (TransformerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}