Inclusion Criteria:  Able to provide written informed consent Adult (age ≥ 18 years) Cancer must have progressed after treatment with all approved and medically appropriate therapies or have no appropriate available therapies  Histologically confirmed diagnosis of one of the following tumor types, along with clinical/pathologic confirmation of the additional requirements for each indication, as appropriate:  Persistent or recurrent clear cell carcinoma of the ovary, peritoneum, or endometrium after treatment with platinum-based systemic chemotherapy Persistent or recurrent high-grade serous carcinoma of the ovary, fallopian tube, or peritoneum after treatment with platinum-based systemic chemotherapy (except subjects with a diagnosis of carcinosarcoma) Recurrent or metastatic cervical carcinoma previously treated with standard-of-care systemic chemotherapy and FDA-approved immunotherapy, if eligible Advanced endometrial carcinoma that is not microsatellite instability-high (MSI-H) or deficient mismatch repair (dMMR) in patients who are not candidates for curative surgery or radiation, and that has progressed following treatment with no more than one prior line of systemic therapy and prior treatment with FDA-approved combination therapy consisting of a checkpoint inhibitor and a targeted agent  High-risk metastatic castration-resistant prostate cancer:  Castration resistance defined as progressive disease after surgical castration, or progression in the setting of medical androgen ablation with a castrate level of testosterone (< 50 ng/dL) High-risk disease is any visceral, soft tissue, or lymph node metastasis(es) with/without bone metastases Measurable disease by Response Evaluation Criteria in Solid Tumours (RECIST 1.1) Adequate available archival formalin-fixed paraffin-embedded block(s)/slides containing tumor and/or adequate predose fresh tumor biopsy tissue Eastern Cooperative Oncology Group performance status of 0 or 1 Female subjects of childbearing potential must agree to use a highly effective method of birth control during and for 4 weeks after completion of study. Women are considered to be of childbearing potential unless it is documented that they are over the age of 60 OR postmenopausal by history with no menses for 1 year and confirmed by follicle-stimulating hormone (using local reference ranges) OR have a history of hysterectomy and/or bilateral oophorectomy OR have a history of bilateral tubal ligation. Highly effective methods of birth control include hormonal birth control (oral, intravaginal, or transdermal), or progestogen-only hormonal contraception associated with inhibition of ovulation (oral, injectable, or intrauterine), intrauterine devices (IUDs), intrauterine hormone-releasing system, bilateral tubal occlusion, vasectomized partner (provided partner is the sole sexual partner and there has been a medical assessment of surgical success), or sexual abstinence Fertile male subjects must be willing to practice a highly effective method of birth control during and for 4 weeks after completion of study Male subjects must agree not to donate sperm from screening through 4 weeks after completion of study Able and willing to complete the entire study according to the study schedule  Exclusion Criteria:  - Subjects currently receiving other anticancer therapies, except that subjects with prostate cancer may continue to receive luteinizing hormone-releasing hormone (LHRH) analogue therapy More than 2 prior chemotherapy regimens for subjects in the cervical cancer, CCC, HGSOC, or prostate cancer cohorts Prior treatment with a CTLA4-targeted agent  Prior treatment with nivolumab, pembrolizumab, or any other PD1-, PDL1- or programmed cell death ligand 2- (PDL2)-directed therapy, except that:  Subjects with MSS EC may have received anti-PD1 therapy as part of an FDA-approved regimen in the approved disease setting Subjects with cervical cancer may have received anti-PD1 therapy as an FDA-approved agent in the approved disease setting Treatment with any other anticancer therapy within 2 weeks of the start of study drug (ie, other immunotherapy, chemotherapy, radiation therapy, etc.) A life-threatening (Grade 4) immune-mediated adverse event (AE) associated with prior administration of an immunotherapy agent Failure to recover from any immunotherapy-related toxicity from prior cancer therapy to ≤ Grade 1, except that subjects are eligible if a previous immunotherapy-related endocrinopathy is medically managed with hormone replacement therapy only Failure to recover from any other cancer therapy-related toxicity (other than immune-related toxicity) related to previous anticancer treatment to ≤ Grade 2 Have known active central nervous system metastases and/or carcinomatous meningitis Platelet count < 100 × 109/L Hemoglobin level ≤ 9.0 g/dL Absolute neutrophil count < 1.5 × 109/L Aspartate aminotransferase (AST) at screening > 3 × upper limit of normal (ULN) for subjects without known liver involvement by tumor; or > 5 × ULN for subjects with known liver involvement by tumor Alanine aminotransferase (ALT) at screening > 3 × ULN for subjects without known liver involvement by tumor; or > 5 × ULN for subjects with known liver involvement by tumor Bilirubin ≥ 1.5 × ULN (unless prior diagnosis and documentation of ongoing hemolysis or Gilbert's syndrome has been made) Estimated creatinine clearance < 50 mL/minute calculated by the Cockcroft Gault or Modification of Diet in Renal Disease formulas Active known or suspected autoimmune disease (except that subjects are permitted to enroll if they have vitiligo; type 1 diabetes mellitus or residual hypothyroidism due to an autoimmune condition that is treatable with hormone replacement therapy only; autoimmune adrenal insufficiency that is managed with low-dose corticosteroids; psoriasis, atopic dermatitis, or another autoimmune skin condition that is managed without systemic therapy; or arthritis that is managed without systemic therapy beyond oral acetaminophen and nonsteroidal anti-inflammatory drugs) • Has any condition requiring systemic treatment with corticosteroids, prednisone equivalents, or other immunosuppressive medications within 14 days prior to first dose of study drug (except that inhaled or topical corticosteroids or brief courses of corticosteroids given for prophylaxis of contrast dye allergic response are permitted) Receipt of an organ allograft History of small or large bowel obstruction within 3 months of enrollment, including subjects with palliative gastric drainage catheters. Subjects with palliative diverting ileostomy or colostomy are allowed if they have been symptom-free for more than 3 months. Ongoing bowel perforation or presence of bowel fistula or intra-abdominal abscess Subjects with refractory ascites, for example, ascites needing drainage catheter or therapeutic paracentesis more often than every 4 weeks Histologic diagnosis of carcinosarcoma of the ovary Symptomatic cord compression, or clinical or radiologic findings indicative of impending cord compression History or evidence of any other clinically unstable/uncontrolled disorder, condition, or disease (including, but not limited to, cardiopulmonary, renal, metabolic, hematologic, or psychiatric) other than their primary malignancy, that, in the opinion of the Investigator, would pose a risk to patient safety or interfere with study evaluations, procedures, or completion Evidence of any serious bacterial, viral, parasitic, or systemic fungal infections within the 30 days prior to the first dose of study drug Receipt of a live-virus vaccine within 30 days prior to first dose of study drug (seasonal flu and COVID-19 vaccines are permitted, as long as they do not contain live virus and are not administered within 24 hours of planned administration of XmAb20717) An HIV-positive subject with CD4+ T-cell (CD4+) counts < 350 cells/μL, or an HIV viral load greater than 400 copies/mL, or a history of an acquired immunodeficiency syndrome (AIDS)-defining opportunistic infection within the past 12 months, or who has not been on established antiretroviral therapy (ART) for at least 4 weeks prior to initiation of study drug dosing. (Effective ART is defined as a drug, dosage, and schedule associated with reduction and control of the viral load. HIV positive subjects who do not meet any of these exclusion criteria are eligible.) Positive test for hepatitis C RNA (a subject who is hepatitis C virus [HCV] antibody positive but HCV RNA negative due to documented, curative prior antiviral treatment or natural resolution is eligible) Positive test for hepatitis B surface antigen (HBsAg) or hepatitis B core antibody (HBcAb); a subject whose HBsAg is negative and HBcAb is positive may be enrolled if a hepatitis B virus (HBV) DNA test is negative and the subject is retested for HBsAg and HBV DNA every 2 months. (See the protocol for treatment requirements for subjects with HBV who become HBsAg and HBV DNA positive during the study.) Subject is pregnant or breastfeeding or planning to become pregnant while enrolled in the study, up to the final end-of-treatment visit Positive urine pregnancy test (ie, urine human chorionic gonadotropin)