  Stanley [9] introduced the chromatic symmetric function ${\bf X}_G$
associated to a simple graph $G$ as a generalization of the chromatic
polynomial of $G$. In this paper we present a novel technique to write ${\bf
X}_G$ as a linear combination of chromatic symmetric functions of smaller
graphs. We use this technique to give a sufficient condition for two graphs to
have the same chromatic symmetric function. We then construct an infinite
family of pairs of unicyclic graphs with the same chromatic symmetric function,
answering the question posed by Martin, Morin, and Wagner [7] of whether such a
pair exists. Finally, we approach the problem of whether it is possible to
determine a tree from its chromatic symmetric function. Working towards an
answer to this question, we give a classification theorem for single-centroid
trees in terms of data closely related to its chromatic symmetric function.
