// lookup mapping node for the user command
GroupSymbol group = xmlQuery.getFrom().getGroups().iterator().next();
MappingDocument doc = (MappingDocument)metadata.getMappingNode(group.getMetadataID());
doc = (MappingDocument)doc.clone();
// make a copy of the document
planEnv.mappingDoc = doc;
planEnv.documentGroup = group;
planEnv.xmlCommand = (Query) command;