Perhaps the API isn't the best then. Assuming this isn't being used to search arbitrary style trees, it might indicate getStyleElement should take an enum: "Auto", "Common", "All"? Friedrich's opinion on this would possibly be stronger than mine though :)