String value = answer.str();
Object value; try { if (answer.getType() == XObject.CLASS_NUMBER) { value = NumberUtils.createNumber(answer.str()); } else if (answer.getType() == XObject.CLASS_BOOLEAN) { value = new Boolean(answer.bool()); } else {  value = answer.str(); } } catch (TransformerException e) { value = answer.str(); } catch (NumberFormatException e) { value = answer.str(); }
    public void setOutProperty(XSLProcessorContext context, ElemTemplateElement element) throws MessagingException, SAXNotSupportedException {        NormalizedMessage out = getOutMessage(context, element);        String name = element.getAttribute("name");        if (name == null) {            throw new IllegalArgumentException("Must specify a 'name' attribute to set a property on the output message");        }        String xpath = element.getAttribute("select");        if (xpath == null) {            throw new IllegalArgumentException("Must specify a 'select' attribute to set a property on the output message");        }        XObject answer = ExsltDynamic.evaluate(context.getTransformer().getXPathContext().getExpressionContext(), xpath);        String value = answer.str();        out.setProperty(name, value);    }