public void deleteindex(int id, String location) {

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

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

			Element root = doc.getDocumentElement();
			NodeList urlinformation = root.getElementsByTagName("urlinfo");
			for (int i = 0; i < urlinformation.getLength(); i++) {

				//	   System.out.println("???");
				NodeList list = urlinformation.item(i).getChildNodes();
				int temp = Integer.parseInt(list.item(1).getTextContent());
				Node nd = urlinformation.item(i);
				if (id == temp) {
					System.out.println("here");
					Node catParent = nd.getParentNode();
					catParent.removeChild(nd);

				}

				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();
		}

	}