def dumpHierarchyImpl(self, node, onlyVisibleNode=True):
if not node:<EOL><INDENT>return None<EOL><DEDENT>payload = {}<EOL>for attrName, attrVal in node.enumerateAttrs():<EOL><INDENT>if attrVal is not None:<EOL><INDENT>payload[attrName] = attrVal<EOL><DEDENT><DEDENT>result = {}<EOL>children = []<EOL>for child in node.getChildren():<EOL><INDENT>if not onlyVisibleNode or child.getAttr('<STR_LIT>'):<EOL><INDENT>children.append(self.dumpHierarchyImpl(child, onlyVisibleNode))<EOL><DEDENT><DEDENT>if len(children) > <NUM_LIT:0>:<EOL><INDENT>result['<STR_LIT>'] = children<EOL><DEDENT>result['<STR_LIT:name>'] = payload.get('<STR_LIT:name>') or node.getAttr('<STR_LIT:name>')<EOL>result['<STR_LIT>'] = payload<EOL>return result<EOL>
Crawl the hierarchy tree using the simple DFS algorithm. The ``dump`` procedure is the engine independent as
the hierarchy structure is wrapped by :py:class:`AbstractNode <poco.sdk.AbstractNode>` and therefore the
``dump`` procedure can be algorithmized.

Following code demonstrates the simplest implementation. Feel free to implement your own algorithms to
optimize the performance.

.. note:: Do not explicitly call this method as this is an internal function, call
          :py:meth:`dumpHierarchy() <poco.sdk.AbstractDumper.AbstractDumper.dumpHierarchy>` function instead
          if you want to dump the hierarchy.

Args:
    node(:py:class:`inherit from AbstractNode <poco.sdk.AbstractNode>`): root node of the hierarchy to be
     dumped
    onlyVisibleNode(:obj:`bool`): dump only the visible nodes or all nodes, default to True

Returns:
    :obj:`dict`: json serializable dict holding the whole hierarchy data