modified to resolve ref after parsing XSD