in reply to using TreeBuilder in perl
Also , if you're not getting the data you think you should be getting, use Basic debugging checklist item 4 ( Dumper )