If it's XHTML, you probably need a namespace binding on the expression
Namspace ns = NAmespave.getNamespace("x", "http://www.w3.org/1999/xhtml");
XPathExpression expr = xpath.compile(
".//x:li[@class='g']/x:div/x:h3/x:em/text()", null, null, ns);