I'm not a huge fan of the name "dump". Not sure what is better. Maybe treeToDebugString, but that's longer >.<

also:
remove var :)
if parameter name is "stylesheet" should type be StyleSheet? Or should parameter name be "node"