From a (quick) look at it, I think tidy is return the information in serialized format, so you need to do this:
Code:
$str = get_tidy_data(); // or whatever you do...
$results = unserialize($str);
It seems that the unserialzed object will be a numerically-indexed array with two elements. Once you've unserialized the data, you can take a quick look with
Code:
echo '<pre>';
print_r($results);
echo '</pre>';
The PHP manual page for unserialize is here:
http://us3.php.net/manual/en/function.unserialize.php
As for traversal, well, at that point it's like traversing any array in PHP.
Alternatively, if you want to provide a fancy interactive Javascript tree browser, you might want to see if tidy can return the data in JSON format, or if there's a php-serialized-to-json converter out there (if not, it's a simple two-step affair to go from the unserialized array to JSON).
The JSON page is here
http://json.org/