I guess we will assume this is a question about how to do this in DOM and not XSLT...
In DOM land there is no nice clean way to do what you want. I assume you have a nodeList object which you got from the children property of another node or somesuch.
Your best bet is to iterate through the nodeList object, which has a method, item(index) which will return the node with the given index, and a property, length which tells you how many items there are. So just use a for loop to sift through them and test each node you find to see if its got the property value you are interested in.
This sort of thing is a pain in the arse using DOM. Now some DOM implementations will let you use an XPath statement to create a nodeList, in which case XPath of the form
will select image elements which are children of the current element and have a group attribute who's value is 1.