Remove all marks based on type AND attribute

It seems that removeMark can be used to remove all marks for a specific type – for example all bold, or all italics. But how about removing all marks based on type AND attribute? For example, al links that have a href set to should be removed? (or maybe exchanged with other links). What’s the best way to go about that?

Again, my initial approach is to walk through the the editor.doc structure. There I would look for all the nodes I need and have their path/offset calculated and then use removeMark on all the marks that happen to have the attribute value I want to get rid off.

Sorry, I should have investigated this better. I guess I should just copy the removeMark function ( ) and modify it slightly to get what I want.