in reply to searching complex data structures

You could consider reading the structure into an XML DOM object, that way you can use XPath expressions to query the data.

Hope this helps, -gjb-