reads XML representation of grammar and creates AGM.