def METHOD_NAME(xml_instance_path, username):
    # check if its a valid xml instance
    file_name = os.path.basename(xml_instance_path)
    xml_file = django_file(
        xml_instance_path,
        field_name="xml_file",
        content_type="text/xml")
    media_files = []
    try:
        date_created = _date_created_from_filename(file_name)
    except ValueError as e:
        sys.stderr.write(
            "Couldn't determine date created from filename: '%s'\n" %
            file_name)
        date_created = datetime.now()
    sys.stdout.write("Creating instance from '%s'\n" % file_name)
    try:
        create_instance(
            username, xml_file, media_files,
            date_created_override=date_created)
        return 1
    except Exception as e:
        sys.stderr.write(
            "Could not restore %s, create instance said: %s\n" %
            (file_name, e))
        return 0