If I have a simple document like:

```
<p> hi </p>
<q> hello </q>
<p> bye </p>
<q> try </q>
<p> why </p>

```

And I store it in a BeautifulSoup object called `doc`, calling:

```
> doc.select('p, q')
[<p> hi </p>, <p> bye </p>, <p> why </p>, <q> hello </q>, <q> try </q>]

```

**Is it possible to get these elements in the correct order**? I would like to number these tags so that "hi" gets 1, "hello" gets 2 and so on... This is a minimal example, but in practice I will have to select by class, id and tag name.