Question: ```
<a id ="1">
...<c>
......<b/>
......<f/>
......<b/>
......<f/>
...</c>
</a>
<a id="2">
...<c>
......<b/>
......<f/>
......<f/>
...</c>
</a>

```

If any elem b is followed by two or more f elements in order, return node a. I prefer straight XPath 2.0 solution, if possible. What xpath will get me a2 but not a1? I have tried following siblings, position, and such, to no avail.

Answer: 
Something like below will work using **XPATH 1.0**:

```
//b[following-sibling::*[
       position()=1 and self::f
       and
       ./following-sibling::*[
                                position()= 1 and self::f
                             ]
                        ]
   ]/ancestor::a[1]

```

**output**

```
<a id="2">
...<c>
......<b/>
......<f/>
......<f/>
...</c>
</a>

```
I came up with this:

```
/a//c[f/following-sibling::*[1] = f]

```