code: public Object with(XMLOutput out, Closure c) {
          XMLOutput old = setOutput(out);
          try {
              c.setDelegate(this);
              return c.call();
          } finally {
              setOutput(old);
          }
      }
docs: Executes the closure with the specified {@link XMLOutput}.