public function getDefinition($format = 'yml', $node = null)
    {
        switch (mb_strtolower($format)) {
            case 'json':
                $dumper = new JsonReferenceDumper();
                break;

            case 'yml':
            case 'yaml':
                $dumper = new YamlReferenceDumper();
                break;

            case 'php':
            default:
                $dumper = new PhpReferenceDumper();
                break;
        }

        $definition = $this->definition;
        $definition = $definition->getConfigTreeBuilder()->buildTree();
        if ($node && $definition instanceof ArrayNode) {
            $definition = $definition->getChildren()[$node];
        }

        return $dumper->dumpNode($definition);
    }