I have checked many tools like "freemind", "freeplane", etc. Most of them allow exporting to XML file output but I didn't get how to convert an XML to a MindMap.
Any suggestions?
Both, FreeMind and Freeplane, can import from several XML formats but there is no general XML-to-mindmap converter since there are many, many existing XML formats and for each format you need a distinct mapping from the different XML elements, attributes, sub-elements and what more to the different elements (node text, maybe attributes, notes, ...) in a mindmap.
FreeMind and Freeplane use an XML dialect as their own proprietary file format (.mm) so one way to convert some XML to a mindmap would be a XML-to-XML transformation via XSLT or Xquery. Both programs also understand to import indented text like this
root node
first child
grandchild
second child
as a node hierarchy, e.g. when pasted into a map.
References: