The first question: does the query ask about a subtree or a path between two nodes?
Subtree queries (all nodes under vertex v) use Euler Tour to flatten the tree into a range. Then you use a segment tree or Fenwick tree on that range. This converts tree queries into array range queries.
Path queries (all nodes from u to v) need different tools. Without updates, use LCA with preprocessing. With updates, use Heavy-Light Decomposition. The choice depends on whether values change.