Added method for determining kind and appending child nodes.