ret.children = parse(children); return ret;
  final TemplateNode parseNumber(Node node, Node children, Node next)    throws TransformerConfigurationException, XPathExpressionException  {    NamedNodeMap attrs = node.getAttributes();    String v = getAttribute(attrs, "value");    String ff = getAttribute(attrs, "format");    if (ff == null)      {        ff = "1";      }    TemplateNode format = parseAttributeValueTemplate(ff, node);    String lang = getAttribute(attrs, "lang");    String lv = getAttribute(attrs, "letter-value");    int letterValue = "traditional".equals(lv) ?      AbstractNumberNode.TRADITIONAL :      AbstractNumberNode.ALPHABETIC;    String gs = getAttribute(attrs, "grouping-separator");    String gz = getAttribute(attrs, "grouping-size");    int gz2 = (gz != null && gz.length() > 0) ?      Integer.parseInt(gz) : 1;    if (v != null && v.length() > 0)      {        Expr value = (Expr) xpath.compile(v);        return new NumberNode(parse(children), parse(next),                              value, format, lang,                              letterValue, gs, gz2);      }    else      {        String l = getAttribute(attrs, "level");        int level =          "multiple".equals(l) ? NodeNumberNode.MULTIPLE :                      "any".equals(l) ? NodeNumberNode.ANY :                      NodeNumberNode.SINGLE;        String c = getAttribute(attrs, "count");        String f = getAttribute(attrs, "from");        Pattern count = null;        Pattern from = null;        if (c != null)          {            try              {                count = (Pattern) xpath.compile(c);              }            catch (ClassCastException e)              {                String msg = "invalid pattern: " + c;                throw new TransformerConfigurationException(msg);              }          }        if (f != null)          {            try              {                from = (Pattern) xpath.compile(f);              }            catch (ClassCastException e)              {                String msg = "invalid pattern: " + f;                throw new TransformerConfigurationException(msg);              }          }        return new NodeNumberNode(parse(children), parse(next),                                  level, count, from,                                  format, lang,                                  letterValue, gs, gz2);      }  }