def METHOD_NAME(options=None, state=None):
    """
    Get the requests options from salt.
    """
    if state:
        _state = "0"
    else:
        _state = "2"
    xml = "<?xml version='1.0'?>\n<checkresults>\n"
    # No service defined then we set the status of the hostname
    if options.get("service"):
        xml += (
            "<checkresult type='service' checktype='" + str(options["checktype"]) + "'>"
        )
        xml += "<hostname>" + html.escape(options["hostname"]) + "</hostname>"
        xml += "<servicename>" + html.escape(options["service"]) + "</servicename>"
    else:
        xml += "<checkresult type='host' checktype='" + str(options["checktype"]) + "'>"
        xml += "<hostname>" + html.escape(options["hostname"]) + "</hostname>"
    xml += "<state>" + _state + "</state>"
    if options.get("output"):
        xml += "<output>" + html.escape(options["output"]) + "</output>"
    xml += "</checkresult>"
    xml += "\n</checkresults>"
    return xml