SQL reduction and XML schema modification