Question: I am going through some "badly" designed pages that have a hierarchy that looks something like this...

```
<h1>
    <span id=English>English</span>
</h1>
<div>go</div>
<p>verb - to move from one place to another</p>
<h1 id=Spanish>Spanish</h1>
<div>va</div>
<p>verb - to move from one place to another</p>

```

The point here is that things are not hierarchical and I need a way to get the p (or whatever else) that comes after a certain id without going down in the hierarchy. 

Can this be done?

Answer: 
You can use `following-sibling::p` and limit the result to `1`. For example, the following XPath should return `<p>verb - to move from one place to another</p>` :

```
//h1[@id='Spanish']/following-sibling::p[1]

```
You can try by using [preceding](https://developer.mozilla.org/en-US/docs/Web/XPath/Axes/preceding) axes as below :-

```
//p[preceding::h1[@id='Spanish']]

```

Hope it helps...:)