Question: Here is a simple TikZ tree:

```
\begin{tikzpicture}
  \node {root}
    child {node {left}}
    child {node {right}
      child {node {child}}
      child {node {child}}
    };
\end{tikzpicture}

```

In this example, the children are appended to the *root* node in the same statement. How to attach children (`child`) to the *root* `node` in a later statement?

```
\begin{tikzpicture}
  \node (root) {root}; % declare root

  % do something else

  ... % reference root node and attach children to it
    child {node {left}}
    child {node {right}
      child {node {child}}
      child {node {child}}
    };
\end{tikzpicture}

```

I want to do this because the *root* `node` is created in a loop.

Answer: 
OK, I understood, at least I think I did.
Here's a proposal:

```
\documentclass[border=10pt]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

  % Create first node which is the fake tree root node  
  \node (root) {root};

  % Do whatever you want

  % Call back your fake root node and place your real tree node on it
  % using \phantom to exactly copy the fake one

  \node at (root) {\phantom{root}}
        child   {   node {left}}
        child   {   node {right}
                    child {node {child 1}}
                    child {node {child 2}}
                };
\end{tikzpicture}

\end{document}

```

Same image is produced, so I didn't add any.  

All this, provided you do everything into the same `tikzpicture`.
I am not sure what exactly you want to achieve, but you can always name nodes to later reference them, like so:

```
\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}

  \node (root) {root}
    child {node {left}}
    child {node {right}
      child {node {child}}
      child {node (one) {child}}
    };

  \draw[red] (one) to [bend right=60] (root);

\end{tikzpicture}
\end{document}

```

[![enter image description here](https://i.stack.imgur.com/J0aGl.png)](https://i.stack.imgur.com/J0aGl.png)