Philips interview question

Design an algorithm for walking a tree-like data structure and serialize it XML