public Expression compile(Executable exec) throws TransformerConfigurationException {
Block block = new Block();
compileChildren(exec, block, true);
try {
While w = new While(test, block.simplify(getStaticContext()));
ExpressionTool.makeParentReferences(w);
return w;
} catch (XPathException e) {
compileError(e);
return null;