Q:

Selenium Webdriver - Selecting an item in a tree node

I'm trying to select certain items in a tree node.  Ideally, I would like to do the following:
1) Select "Child Item One" from the Tree View based on the text of the item.
Here is the HTML of the Tree object:
 <div id="form:treeSingle" class="ui-tree ui-widget ui-widget-content ui-corner-all 
          treeMenu" aria-multiselectable="true" role="tree">
    <ul class="ui-tree-container">
       <li id="form:treeSingle:0" class="ui-treenode ui-treenode-parent ui-treenode-
              unselected" role="treeitem" data-nodetype="default" data-rowkey="0">
         <span class="ui-treenode-content ui-tree-selectable" aria-selected="false" 
                       aria-expanded="true">
            <span class="ui-tree-toggler ui-icon ui-icon-triangle-1-s"/>
          <span/>
          <span class="ui-treenode-label ui-corner-all ui-state-hover">Top Level 
                     Perm</span>
          </span>
             <ul class="ui-treenode-children">
                <li id="form:treeSingle:0_0" class="ui-treenode ui-treenode-parent 
                        ui-treenode-selected" role="treeitem" data-
                        nodetype="default" data-rowkey="0_0">
                    <span class="ui-treenode-content ui-tree-selectable" aria- 
                          selected="true" aria-expanded="true">
                       <span class="ui-tree-toggler ui-icon ui-icon-triangle-1-s"/>
                    <span/>
                    <span class="ui-treenode-label ui-corner-all ui-state-
                          highlight">Child Item One</span>
                    </span>

Any Help is appreciated.

A:

see the getting started example here, your xpath should look like:
driver.findElements(By.xpath("//span[text()='Child Item One']"))

