String title = "";
String title = "TITLE UNKNOWN";
    public String getDocumentTitle(org.w3c.dom.Document doc) {        String title = "";        try {            //org.apache.xpath.objects.XObject xo = XPathAPI.eval(doc.getDocumentElement(), "//xh:head/xh:title/text()", pres);            org.apache.xpath.objects.XObject xo = XPathAPI.eval(doc.getDocumentElement(), "//head/title/text()");            org.w3c.dom.NodeList nl = xo.nodelist();            if (nl.getLength() == 0) {                System.err.println("Apparently no title element for this document.");                title = "TITLE UNKNOWN";            } else {                title = nl.item(0).getNodeValue();            }        } catch (Exception ex) {            System.err.println("Error retrieving document title. " + ex.getMessage());            title = "";        }        return title;    }