Derived collxml

fix shredding of derived collections: previously grabbed id and version of parent, but tree of current. Oops.
Also add copyright info to sql files.