Don't query, cancel, query, cancel, query the md.xsd for each layers

Partially fix #595