Grammatical Inference is the technique by which a grammar that best describes a given set of input samples is inferred. This paper considers the inference of tree grammars from a set of sample input trees. Inference of grammars for fixed arity trees is well studied, in this paper we extend the method to give algorithms for inference of grammars for variable arity trees. We give algorithms for inference of local, single type and regular grammar and also consider the use of negative samples. The variable arity trees we consider can be used for representation of XML documents and the algorithms we have given can be used for validation as well as for schema inference. © 2007 IEEE.