static boolean readEnabled(Element endpointElement, Optional<String> zoneEndpointType, String msgPrefix) {
        return XML.attribute("enabled", endpointElement)
                  .map(value -> {
                      if (zoneEndpointType.isEmpty() || ! zoneEndpointType.get().equals("zone"))
                          illegal(msgPrefix + "only endpoints of type 'zone' can specify 'enabled'");

               return switch (value) {
                   case "true" -> true;
                   case "false" -> false;
                   default -> throw new IllegalArgumentException(msgPrefix + "invalid 'enabled' value; must be 'true' or 'false'");
               };
           }).orElse(true);
    }
@param parentElement
@param endpointElement
@param level decide what this method is reading TODO: Split into different methods instead
@param instance the instance this applies to, or empty if it does not apply to an instance (application endpoints)
@param steps
@param forRegions the regions this applies to (for bcp), or empty (otherwise) to read this from "region" subelements
@param endpointsByZone a map containing any zone endpoints read by this
@return the endpoint read, unless it is added to endspointsByZone instead *sob*
config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java