XSD: Check element->type references. Also, save attributes on flat-references.