private static int getMaxOccursImpl(XmlTag tag) {
    if (tag == null) return 1;
    String value = tag.getAttributeValue("maxOccurs");
    if (value == null) return 1;
    if ("unbounded".equals(value)) return Integer.MAX_VALUE;
    try {
      return Integer.parseInt(value);
    }
    catch (NumberFormatException e) {
      return 1;
    }
  }
private static int getMaxOccursImpl(XmlTag tag)