How to find the all userTask elements before the specified userTask element

This might be difficult, since you have to define first, what before means.

a) visually (x-coordinate)
b) flow-wise

In terms of b), you could solve this by chaining through the incoming properties and then identify bpmn:UserTask elements.