added tree structure for proper formation of the node-tree from the xml elements.