+1  A: 

I suggest using the new Java WURFL API to load and trawl through the capabilities database. It's pretty flexible that way, you should be able to implement your pseudo-code pretty quickly.

skaffman
Thanks for the note. We have looked into the new API, and while it offers some better ways then the old API it still seems like a hack, and it's not fast. For now we are doing it and caching the result so it is OK.
beggs
A: 

I'm not aware of an API for this task. I've had to deal with this myself and ended up coding a public site to handle it: http://wurfl.ditherandbicker.com/

Since the base WURFL XML file is built for portability, a device's full capability matrix must be derived by reading from a variable number of "fall back devices". Many other WURFL-based projects behave the same way. In my experience you really need to translate the default, nested, data structure into a flat one if you hope to get any decent speed with your searches. Of course at that point you lose the portability benefits.

Chris