class NavTree {
private void clickRootNode() throws IOException, EmbJoprTestException {
DomElement element = (DomElement)client.getElement("navTreeForm");
if( null == element )
throw new HtmlElementNotFoundException("Can't find #navTreeForm.");
// ID changes upon core build?
//HtmlAnchor rootNodeLink = element.getFirstByXPath("//a[@id='navTreeForm:navTree:2::homeLink']");
// javax.xml.transform.TransformerException: Can't find function: matches
//HtmlAnchor rootNodeLink = element.getFirstByXPath(
// "//a[matches(@id,'^navTreeForm:navTree:.+::homeLink$')]");
String xPath = "//a[ starts-with( @id, 'navTreeForm:navTree:' ) " +
" and contains( @id, '::homeLink' ) ]"; // XPath 2.0: ends-with( @id, '::homeLink' )
HtmlAnchor rootNodeLink = element.getFirstByXPath(xPath);
if( null == rootNodeLink )
throw new HtmlElementNotFoundException("Root node not found using XPath: "+xPath);
rootNodeLink.click();
}