Question: I have the following document:

```
<a>
  <bb>abc</bb>
  <cc>ccc</cc>
  <dd>ddd</dd>
</a>
<a>
  <bb>zz</bb>
  <cc>1</cc>
  <dd>2</dd>
</a>

```

How can I get the value of `<cc>` using XPath if `<bb>` is `zz`?

Answer: 
Q: *How to select a node using XPath if sibling node has a specific value?*  

Because there are only "XPath Axes" for following-siblings and preceding-siblings, you can use one of them if the position is fixed. 

**But better:**
Look for `cc` were the parent has child `bb` with value `'zz'`:

```
//cc[../bb='zz']

```
```
//a/cc[../bb='zz']/text()

```

//a : Selects all 'a' elements no matter where it is.

//a/cc : Selects 'cc' elements that are children of the 'a' element (no matter where a is).

.. : Selects the parent of the current node.

[../bb='zz'] : where value of sibling 'bb' element is zz.

Reference: <http://www.w3schools.com/xsl/xpath_syntax.asp>