How to know in a query if a document is in edit mode

I would need to know how to look with a query that a content is in edit mode by another user, that is, it is blocked by user A and cannot be edited by user B.

Can anybody help me?

something like:

//element(*,hippo:document)[@hippostd:stateSummary='changed' and @hippostd:state='draft' and @hippostdpubwf:lastModifiedBy='userA']

Thanks!!!