private static int getMinOccursImpl(XmlTag tag) {
    if (tag == null) return 1;
    String value = tag.getAttributeValue("minOccurs");
    try {
      return value == null ? 1 : Integer.parseInt(value);
    }
    catch (NumberFormatException e) {
      return 1;
    }
  }
private static int getMinOccursImpl(XmlTag tag)