fixed duplicate node name issue

fixed the issue with result object structure when both an outer node
and a node inside it have same elementName.