It is indeed from Purcell's Funeral Music for Queen Mary.
Some collections only have the instrumental music which begins the funeral music; and the various sections find their way into collections of choral music.
The Prayer Book text of the funeral service is here.
http://www.eskimo.com/~lhowell/bcp1662/occasion/burial.html
When they come to the Grave:
MAN that is born of a woman hath but a short time to live, and is full of misery. He cometh up, and is cut down, like a flower; he fleeth as it were a shadow, and never continueth in one stay.
In the midst of life we are in death: of whom may we seek for succour, but of thee, 0 Lord, who for our sins art justly displeased? Yet, 0 Lord God most holy, 0 Lord most mighty, 0 holy and most merciful Saviour, deliver us not into the bitter pains of eternal death.
Thou knowest, Lord, the secrets of our hearts; shut not thy merciful ears to our prayer; but spare us, Lord most holy, 0 God most mighty, 0 holy and merciful Saviour, thou most worthy judge eternal, suffer us not, at our last hour, for any pains of death, to fall from thee.
This last section "Thou knowest Lord . . ." is often sung as an anthem by itself.
I found this recording in the catalogue
http://www.selections.com/L178/purcell-funeral-music-for-queen-mary/
and free here
http://www.last.fm/music/Henry+Purcell/_/Man+that+is+born+of+a+woman,+Z.+27
http://www.last.fm/music/Henry+Purc.../In+the+midst+of+life+we+are+in+death,+Z.+17A
http://www.last.fm/music/Henry+Purc...west,+Lord,+the+secrets+of+our+hearts,+Z.+58B
which looks like a Naxos
I know of no other setting of the text.
I too thought I had a recording on CD, but can only find "Thou knowest Lord"
The line
"Yet, 0 Lord God most holy, 0 Lord most mighty, 0 holy and most merciful Saviour, deliver us not into the bitter pains of eternal death."
is one of the most heart rending in the English Cathedral repertoire.
Beaten only by the pathos here: Tomkins "When David heard that Absalom was slain . . . "
http://www.last.fm/music/The+Tallis+Scholars/_/Tomkins:+When+David+heard
When it gets to "O my son . . . would God I have died for thee" . . .
At the going down of the sun and in the morning . . .