code: public static StringBuilder buildAstString(ParentSoyNode<?> node, int indent, StringBuilder sb) {
      for (SoyNode child : node.getChildren()) {
        sb.append(Strings.repeat("  ", indent)).append(child.getKind()).append('\n');
        if (child instanceof ParentSoyNode) {
          buildAstString((ParentSoyNode<?>) child, indent + 1, sb);
        }
      }
      return sb;
    }
docs: Given a Soy node, returns a {@code StringBuilder} that can be used to pretty print the AST
  structure.
  
  <p>For example, for the following soy source <code><pre>
  {for i in range(5)}
  {if $i % 2 == 0}
  foo
  {/if}
  {/for}
  </pre></code> This method prints the AST string as follow: <code><pre>
  FOR_NODE
  IF_NODE
  IF_COND_NODE
  PRINT_NODE
  </pre></code>
  
  @param node The root of the AST.
  @param indent The indentation for each level.
  @param sb The StringBuilder instance used for recursion.
  @return The StringBuilder instance.