Changing the order if integration gives
$$ \int_q^1 w(s) \int_0^s e(\xi) d\xi ds = \int_0^q e(\xi) \int_q^1 w(s)\, ds d\xi + \int_q^1 e(\xi)\int_{\xi}^1 w(s)\, ds d\xi .$$
Note that, the first integral on the right hand side can be written as
$$ \int_0^q e(\xi)d\xi \int_q^1 w(s)\, ds = \int_q^1 w(s)\, ds\int_0^q e(\xi)d\xi. $$
Plot the region to see how the first equation derived.
Added: Plot the region $ \xi(s) = s $ where $ q \leq s \leq 1 $. Then to change the order of integration, consider taking a horizontal strip and notice that the horizontal strip will be bounded below by two different functions, namely, $s=q$ and $s=\xi$. Accordingly, find the limits for $\xi$.