Pluck child elements into an object structure based on the value of a named attribute