private static Listing parseListing(StringBuilder l) {

		html2xhtml(l);

		// System.out.println(l);
		Listing listing = new Listing();
		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

		try {

			// Using factory get an instance of document builder
			DocumentBuilder db = dbf.newDocumentBuilder();

			// parse using builder to get DOM representation of the XML file
			Document dom = db.parse(new InputSource(new ByteArrayInputStream(l.toString().getBytes("utf-8"))));

			Element docEle = dom.getDocumentElement();

			NodeList spans = docEle.getElementsByTagName("span");

			Element el;
			String classid;
			String value;

			if (spans != null && spans.getLength() > 0) {
				for (int i = 0; i < spans.getLength(); i++) {

					el = (Element) spans.item(i);

					classid = el.getAttribute("class");

					if (el.getFirstChild() != null) {
						value = el.getFirstChild().getNodeValue();
					} else {
						value = "";
					}

					setListingValue(listing, classid, value);
				}
			}

			NodeList as = docEle.getElementsByTagName("a");

			if (as != null && as.getLength() > 0) {
				el = (Element) as.item(0);

				listing.setDetailURL(el.getAttribute("href"));
				listing.setTitle(el.getFirstChild().getNodeValue());
			}

		} catch (ParserConfigurationException pce) {
			pce.printStackTrace();
		} catch (SAXException se) {
			se.printStackTrace();
		} catch (IOException ioe) {
			ioe.printStackTrace();
		}

		System.out.println(listing.toString());
		return listing;
	}