Before revision:  In this work, we  introduce the first fully polynomial time randomized approximation scheme (FPRAS) for counting the number of trees of size n accepted by a tree automaton, where n is given in unary , and the first polynomial time algorithm for sampling uniformly from this set of trees.
After revision:  In this work, we extend this characterization to the counting problem for conjunctive queries. Specifically, for every class C of conjunctive queries with bounded treewidth, we introduce the first fully polynomial time randomized approximation scheme (FPRAS) for counting the number of trees of size n accepted by a tree automaton, where n is given in unary , and the first polynomial time algorithm for sampling uniformly from this set of trees.