reads DTD and constructs AGM.