<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with the Workiva Platform-->
<!--Copyright 2024 Workiva-->
<!--r:e5d0f0b2-28f0-402b-8ff5-56208266c5ea,g:67c8cf01-c06c-4e46-bd53-697f2af788ac-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xfor="http://www.x4pharma.com/20240331" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:dtr-types1="http://www.xbrl.org/dtr/type/2020-01-21" xmlns:dtr-types="http://www.xbrl.org/dtr/type/2022-03-31" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.x4pharma.com/20240331">
  <xs:import namespace="http://fasb.org/srt/2023" schemaLocation="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd"/>
  <xs:import namespace="http://fasb.org/us-gaap/2023" schemaLocation="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd"/>
  <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.xbrl.org/2003/xlink-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"/>
  <xs:import namespace="http://www.xbrl.org/dtr/type/2020-01-21" schemaLocation="https://www.xbrl.org/dtr/type/2020-01-21/types.xsd"/>
  <xs:import namespace="http://www.xbrl.org/dtr/type/2022-03-31" schemaLocation="https://www.xbrl.org/dtr/type/2022-03-31/types.xsd"/>
  <xs:import namespace="http://xbrl.org/2005/xbrldt" schemaLocation="http://www.xbrl.org/2005/xbrldt-2005.xsd"/>
  <xs:import namespace="http://xbrl.sec.gov/dei/2023" schemaLocation="https://xbrl.sec.gov/dei/2023/dei-2023.xsd"/>
  <xs:annotation>
    <xs:appinfo>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="xfor-20240331_pre.xml" xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="xfor-20240331_def.xml" xlink:role="http://www.xbrl.org/2003/role/definitionLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="xfor-20240331_lab.xml" xlink:role="http://www.xbrl.org/2003/role/labelLinkbaseRef" xlink:type="simple"/>
      <link:linkbaseRef xmlns:xlink="http://www.w3.org/1999/xlink" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" xlink:href="xfor-20240331_cal.xml" xlink:role="http://www.xbrl.org/2003/role/calculationLinkbaseRef" xlink:type="simple"/>
      <link:roleType id="CoverPage" roleURI="http://www.x4pharma.com/role/CoverPage">
        <link:definition>0000001 - Document - Cover Page</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONDENSEDCONSOLIDATEDBALANCESHEETS" roleURI="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDBALANCESHEETS">
        <link:definition>0000002 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONDENSEDCONSOLIDATEDBALANCESHEETSParenthetical" roleURI="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDBALANCESHEETSParenthetical">
        <link:definition>0000003 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS (Parenthetical)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVELOSS" roleURI="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVELOSS">
        <link:definition>0000004 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF OPERATIONS AND COMPREHENSIVE LOSS</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONDENSEDCONSOLIDATEDSTATEMENTSOFCONVERTIBLEPREFERREDSTOCKREDEEMABLECOMMONSTOCKANDSTOCKHOLDERSEQUITYDEFICIT" roleURI="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCONVERTIBLEPREFERREDSTOCKREDEEMABLECOMMONSTOCKANDSTOCKHOLDERSEQUITYDEFICIT">
        <link:definition>0000005 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF CONVERTIBLE PREFERRED STOCK, REDEEMABLE COMMON STOCK AND STOCKHOLDERS' EQUITY (DEFICIT)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWS" roleURI="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWS">
        <link:definition>0000006 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NatureoftheBusinessandBasisofPresentation" roleURI="http://www.x4pharma.com/role/NatureoftheBusinessandBasisofPresentation">
        <link:definition>0000007 - Disclosure - Nature of the Business and Basis of Presentation</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPolicies" roleURI="http://www.x4pharma.com/role/SummaryofSignificantAccountingPolicies">
        <link:definition>0000008 - Disclosure - Summary of Significant Accounting Policies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LicenseCollaborationandFundingAgreements" roleURI="http://www.x4pharma.com/role/LicenseCollaborationandFundingAgreements">
        <link:definition>0000009 - Disclosure - License, Collaboration, and Funding Agreements</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueofFinancialAssetsandLiabilities" roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilities">
        <link:definition>0000010 - Disclosure - Fair Value of Financial Assets and Liabilities</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyandEquipmentNet" roleURI="http://www.x4pharma.com/role/PropertyandEquipmentNet">
        <link:definition>0000011 - Disclosure - Property and Equipment, Net</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AccruedExpenses" roleURI="http://www.x4pharma.com/role/AccruedExpenses">
        <link:definition>0000012 - Disclosure - Accrued Expenses</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LongTermDebt" roleURI="http://www.x4pharma.com/role/LongTermDebt">
        <link:definition>0000013 - Disclosure - Long-Term Debt</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="Leases" roleURI="http://www.x4pharma.com/role/Leases">
        <link:definition>0000014 - Disclosure - Leases</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommitmentandContingencies" roleURI="http://www.x4pharma.com/role/CommitmentandContingencies">
        <link:definition>0000015 - Disclosure - Commitment and Contingencies</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommonStockWarrants" roleURI="http://www.x4pharma.com/role/CommonStockWarrants">
        <link:definition>0000016 - Disclosure - Common Stock Warrants</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensation" roleURI="http://www.x4pharma.com/role/StockBasedCompensation">
        <link:definition>0000017 - Disclosure - Stock-Based Compensation</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxes" roleURI="http://www.x4pharma.com/role/IncomeTaxes">
        <link:definition>0000018 - Disclosure - Income Taxes</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NetLossperShare" roleURI="http://www.x4pharma.com/role/NetLossperShare">
        <link:definition>0000019 - Disclosure - Net Loss per Share</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesPolicies" roleURI="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesPolicies">
        <link:definition>9954471 - Disclosure - Summary of Significant Accounting Policies (Policies)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesTables" roleURI="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesTables">
        <link:definition>9954472 - Disclosure - Summary of Significant Accounting Policies (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueofFinancialAssetsandLiabilitiesTables" roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesTables">
        <link:definition>9954473 - Disclosure - Fair Value of Financial Assets and Liabilities (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyandEquipmentNetTables" roleURI="http://www.x4pharma.com/role/PropertyandEquipmentNetTables">
        <link:definition>9954474 - Disclosure - Property and Equipment, Net (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AccruedExpensesTables" roleURI="http://www.x4pharma.com/role/AccruedExpensesTables">
        <link:definition>9954475 - Disclosure - Accrued Expenses (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LongTermDebtTables" roleURI="http://www.x4pharma.com/role/LongTermDebtTables">
        <link:definition>9954476 - Disclosure - Long-Term Debt (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesTables" roleURI="http://www.x4pharma.com/role/LeasesTables">
        <link:definition>9954477 - Disclosure - Leases (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommonStockWarrantsTables" roleURI="http://www.x4pharma.com/role/CommonStockWarrantsTables">
        <link:definition>9954478 - Disclosure - Common Stock Warrants (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationTables" roleURI="http://www.x4pharma.com/role/StockBasedCompensationTables">
        <link:definition>9954479 - Disclosure - Stock-Based Compensation (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NetLossperShareTables" roleURI="http://www.x4pharma.com/role/NetLossperShareTables">
        <link:definition>9954480 - Disclosure - Net Loss per Share (Tables)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NatureoftheBusinessandBasisofPresentationAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/NatureoftheBusinessandBasisofPresentationAdditionalInformationDetail">
        <link:definition>9954481 - Disclosure - Nature of the Business and Basis of Presentation - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesScheduleofCompensatingBalanceArrangementsDetail" roleURI="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesScheduleofCompensatingBalanceArrangementsDetail">
        <link:definition>9954482 - Disclosure - Summary of Significant Accounting Policies - Schedule of Compensating Balance Arrangements (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="SummaryofSignificantAccountingPoliciesScheduleofReconciliationofCashCashEquivalentsandRestrictedCashDetail" roleURI="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesScheduleofReconciliationofCashCashEquivalentsandRestrictedCashDetail">
        <link:definition>9954483 - Disclosure - Summary of Significant Accounting Policies - Schedule of Reconciliation of Cash, Cash Equivalents, and Restricted Cash (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LicenseCollaborationandFundingAgreementsAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/LicenseCollaborationandFundingAgreementsAdditionalInformationDetail">
        <link:definition>9954484 - Disclosure - License, Collaboration, and Funding Agreements - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueofFinancialAssetsandLiabilitiesScheduleofAssetsandLiabilitiesMeasuredatFairValueDetail" roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesScheduleofAssetsandLiabilitiesMeasuredatFairValueDetail">
        <link:definition>9954485 - Disclosure - Fair Value of Financial Assets and Liabilities - Schedule of Assets and Liabilities Measured at Fair Value (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueofFinancialAssetsandLiabilitiesDebtSecuritiesAvailableforSaleDetails" roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesDebtSecuritiesAvailableforSaleDetails">
        <link:definition>9954486 - Disclosure - Fair Value of Financial Assets and Liabilities - Debt Securities Available-for-Sale (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueofFinancialAssetsandLiabilitiesAggregateFairValuesFinancialInstrumentsDetails" roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesAggregateFairValuesFinancialInstrumentsDetails">
        <link:definition>9954487 - Disclosure - Fair Value of Financial Assets and Liabilities - Aggregate Fair Values Financial Instruments (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueofFinancialAssetsandLiabilitiesNarrativeDetails" roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesNarrativeDetails">
        <link:definition>9954488 - Disclosure - Fair Value of Financial Assets and Liabilities - Narrative (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="FairValueofFinancialAssetsandLiabilitiesFairValueAssumptionsDetails" roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesFairValueAssumptionsDetails">
        <link:definition>9954489 - Disclosure - Fair Value of Financial Assets and Liabilities - Fair Value Assumptions (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyandEquipmentNetScheduleofPropertyandEquipmentNetDetail" roleURI="http://www.x4pharma.com/role/PropertyandEquipmentNetScheduleofPropertyandEquipmentNetDetail">
        <link:definition>9954490 - Disclosure - Property and Equipment, Net - Schedule of Property and Equipment, Net (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="PropertyandEquipmentNetAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/PropertyandEquipmentNetAdditionalInformationDetail">
        <link:definition>9954491 - Disclosure - Property and Equipment, Net - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="AccruedExpensesScheduleofAccruedExpensesDetail" roleURI="http://www.x4pharma.com/role/AccruedExpensesScheduleofAccruedExpensesDetail">
        <link:definition>9954492 - Disclosure - Accrued Expenses - Schedule of Accrued Expenses (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LongTermDebtSummaryofLongTermDebtDetail" roleURI="http://www.x4pharma.com/role/LongTermDebtSummaryofLongTermDebtDetail">
        <link:definition>9954493 - Disclosure - Long-Term Debt - Summary of Long Term Debt (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LongTermDebtHerculesLoanAgreementAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/LongTermDebtHerculesLoanAgreementAdditionalInformationDetail">
        <link:definition>9954494 - Disclosure - Long Term Debt - Hercules Loan Agreement - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LongTermDebtSummaryofInterestExpenseDetails" roleURI="http://www.x4pharma.com/role/LongTermDebtSummaryofInterestExpenseDetails">
        <link:definition>9954495 - Disclosure - Long-Term Debt - Summary of Interest Expense (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LongTermDebtScheduleofFuturePrincipalPaymentsandtheFinalPaymentsDueDetail" roleURI="http://www.x4pharma.com/role/LongTermDebtScheduleofFuturePrincipalPaymentsandtheFinalPaymentsDueDetail">
        <link:definition>9954496 - Disclosure - Long-Term Debt - Schedule of Future Principal Payments and the Final Payments Due (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/LeasesAdditionalInformationDetail">
        <link:definition>9954497 - Disclosure - Leases - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesScheduleofComponentsofLeaseExpenseDetail" roleURI="http://www.x4pharma.com/role/LeasesScheduleofComponentsofLeaseExpenseDetail">
        <link:definition>9954498 - Disclosure - Leases - Schedule of Components of Lease Expense (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail" roleURI="http://www.x4pharma.com/role/LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail">
        <link:definition>9954499 - Disclosure - Leases - Schedule of Maturities of Lease Liabilities (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail_1" roleURI="http://www.x4pharma.com/role/LeasesScheduleofMaturitiesofLeaseLiabilitiesDetail_1">
        <link:definition>9954499 - Disclosure - Leases - Schedule of Maturities of Lease Liabilities (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommitmentandContingenciesAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/CommitmentandContingenciesAdditionalInformationDetail">
        <link:definition>9954500 - Disclosure - Commitment and Contingencies - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommonStockWarrantsAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/CommonStockWarrantsAdditionalInformationDetail">
        <link:definition>9954501 - Disclosure - Common Stock Warrants - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="CommonStockWarrantsSummaryofOutstandingWarrantstoPurchaseSharesofCommonStockDetail" roleURI="http://www.x4pharma.com/role/CommonStockWarrantsSummaryofOutstandingWarrantstoPurchaseSharesofCommonStockDetail">
        <link:definition>9954502 - Disclosure - Common Stock Warrants - Summary of Outstanding Warrants to Purchase Shares of Common Stock (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/StockBasedCompensationAdditionalInformationDetail">
        <link:definition>9954503 - Disclosure - Stock-Based Compensation - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationScheduleofAssumptionsUsedinBlackScholesOptionPricingModeltoDetermineGrantdateFairValueofStockOptionsGrantedDetail" roleURI="http://www.x4pharma.com/role/StockBasedCompensationScheduleofAssumptionsUsedinBlackScholesOptionPricingModeltoDetermineGrantdateFairValueofStockOptionsGrantedDetail">
        <link:definition>9954504 - Disclosure - Stock-Based Compensation - Schedule of Assumptions Used in Black-Scholes Option-Pricing Model to Determine Grant-date Fair Value of Stock Options Granted (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationSummaryofStockOptionActivityDetail" roleURI="http://www.x4pharma.com/role/StockBasedCompensationSummaryofStockOptionActivityDetail">
        <link:definition>9954505 - Disclosure - Stock-Based Compensation - Summary of Stock Option Activity (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationRestrictedStockUnitsDetails" roleURI="http://www.x4pharma.com/role/StockBasedCompensationRestrictedStockUnitsDetails">
        <link:definition>9954506 - Disclosure - Stock-Based Compensation - Restricted Stock Units (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="StockBasedCompensationSummaryofStockBasedCompensationExpenseClassificationDetails" roleURI="http://www.x4pharma.com/role/StockBasedCompensationSummaryofStockBasedCompensationExpenseClassificationDetails">
        <link:definition>9954507 - Disclosure - Stock-Based Compensation Summary of Stock-Based Compensation Expense Classification (Details)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="IncomeTaxesAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/IncomeTaxesAdditionalInformationDetail">
        <link:definition>9954508 - Disclosure - Income Taxes - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NetLossperShareSummaryofBasicandDilutedNetlossperShareAttributabletoCommonStockholdersDetail" roleURI="http://www.x4pharma.com/role/NetLossperShareSummaryofBasicandDilutedNetlossperShareAttributabletoCommonStockholdersDetail">
        <link:definition>9954509 - Disclosure - Net Loss per Share - Summary of Basic and Diluted Net loss per Share Attributable to Common Stockholders (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NetLossperShareAdditionalInformationDetail" roleURI="http://www.x4pharma.com/role/NetLossperShareAdditionalInformationDetail">
        <link:definition>9954510 - Disclosure - Net Loss per Share - Additional Information (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
      <link:roleType id="NetLossperShareScheduleofAntidilutiveSecuritiesExcludedfromComputationofDilutedNetLossperShareAttributabletoCommonStockholdersDetail" roleURI="http://www.x4pharma.com/role/NetLossperShareScheduleofAntidilutiveSecuritiesExcludedfromComputationofDilutedNetLossperShareAttributabletoCommonStockholdersDetail">
        <link:definition>9954511 - Disclosure - Net Loss per Share - Schedule of Anti-dilutive Securities Excluded from Computation of Diluted Net Loss per Share Attributable to Common Stockholders (Detail)</link:definition>
        <link:usedOn>link:presentationLink</link:usedOn>
        <link:usedOn>link:calculationLink</link:usedOn>
        <link:usedOn>link:definitionLink</link:usedOn>
      </link:roleType>
    </xs:appinfo>
  </xs:annotation>
  <xs:element id="xfor_LineOfCreditCovenantMinimumCash" abstract="false" name="LineOfCreditCovenantMinimumCash" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_SoftwareMember" abstract="true" name="SoftwareMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_WarrantLiabilityMember" abstract="true" name="WarrantLiabilityMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="xfor_LesseeOperatingLeaseLeaseNotYetCommencedAnnualBaseRent" abstract="false" name="LesseeOperatingLeaseLeaseNotYetCommencedAnnualBaseRent" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_AccretionOnLongTermDebt" abstract="false" name="AccretionOnLongTermDebt" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_ContingenciesAndCommitmentsTable" abstract="true" name="ContingenciesAndCommitmentsTable" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrldt:hypercubeItem" type="xbrli:stringItemType"/>
  <xs:element id="xfor_GenzymeAgreementMember" abstract="true" name="GenzymeAgreementMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_TemporaryEquityRepurchaseOfConvertiblePreferredStock" abstract="false" name="TemporaryEquityRepurchaseOfConvertiblePreferredStock" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_FundedMember" abstract="true" name="FundedMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_TwoThousandNineteenEquityIncentivePlanMember" abstract="true" name="TwoThousandNineteenEquityIncentivePlanMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_ViennaLeaseAgreementMember" abstract="true" name="ViennaLeaseAgreementMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_NonCashLeaseExpense" abstract="false" name="NonCashLeaseExpense" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_IssuanceOnMarch232021Member" abstract="true" name="IssuanceOnMarch232021Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_MinCashTestDate1Member" abstract="true" name="MinCashTestDate1Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights" abstract="false" name="ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="dtr-types1:perShareItemType"/>
  <xs:element id="xfor_Q12022PrivatePlacementMember" abstract="true" name="Q12022PrivatePlacementMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceCostsRelatedToSaleOfWarrantsAndFeesPaidForAmendmentsToLoanAndSecurityAgreement" abstract="false" name="IssuanceCostsRelatedToSaleOfWarrantsAndFeesPaidForAmendmentsToLoanAndSecurityAgreement" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_GrantAndIncentiveReceivables" abstract="false" name="GrantAndIncentiveReceivables" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_IssuanceOnSeptemberTwelveTwoThousandEighteenOneMember" abstract="true" name="IssuanceOnSeptemberTwelveTwoThousandEighteenOneMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_LongTermDebtNonCurrentIncludingAccretion" abstract="false" name="LongTermDebtNonCurrentIncludingAccretion" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems" abstract="true" name="FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="xfor_TwoThousandSeventeenEquityIncentivePlanMember" abstract="true" name="TwoThousandSeventeenEquityIncentivePlanMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceOnMarch32022Member" abstract="true" name="IssuanceOnMarch32022Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceOnAprilSixteenTwoThousandNineteenMember" abstract="true" name="IssuanceOnAprilSixteenTwoThousandNineteenMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceOnNovemberNineTwoThousandTwentyOneMember" abstract="true" name="IssuanceOnNovemberNineTwoThousandTwentyOneMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_A6NetSalesMember" abstract="true" name="A6NetSalesMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="xfor_ProceedsFromIssuanceOrSaleOfEquityNetOfIssuanceCosts" abstract="false" name="ProceedsFromIssuanceOrSaleOfEquityNetOfIssuanceCosts" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_IssuanceOnDecember92022Member" abstract="true" name="IssuanceOnDecember92022Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceOnJuly20221Member" abstract="true" name="IssuanceOnJuly20221Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_LongTermDebtAndEOTPayment" abstract="false" name="LongTermDebtAndEOTPayment" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_IssuanceOnDecember920222Member" abstract="true" name="IssuanceOnDecember920222Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_AllstonLeaseAgreementMember" abstract="true" name="AllstonLeaseAgreementMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardsGrantInPeriodWeightedAverageGrantDateFairValue" abstract="false" name="ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardsGrantInPeriodWeightedAverageGrantDateFairValue" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:perShareItemType"/>
  <xs:element id="xfor_LegacyWarrantsMember" abstract="true" name="LegacyWarrantsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_ClassAWarrantMember" abstract="true" name="ClassAWarrantMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_LongTermDebtIncludingAccretion" abstract="false" name="LongTermDebtIncludingAccretion" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_ScheduleOfReconciliationOfCashAndCashEquivalentsAndRestrictedCashToCashFlowsTableTextBlock" abstract="false" name="ScheduleOfReconciliationOfCashAndCashEquivalentsAndRestrictedCashToCashFlowsTableTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:textBlockItemType"/>
  <xs:element id="xfor_IssuanceOnOctoberTwentyFiveTwoThousandSixteenMember" abstract="true" name="IssuanceOnOctoberTwentyFiveTwoThousandSixteenMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IndemnificationAgreementsMember" abstract="true" name="IndemnificationAgreementsMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable" abstract="true" name="FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrldt:hypercubeItem" type="xbrli:stringItemType"/>
  <xs:element id="xfor_AccruedExternalResearchAndDevelopmentExpenses" abstract="false" name="AccruedExternalResearchAndDevelopmentExpenses" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_RevenuePerformanceObligationPercentageOfNetSale" abstract="false" name="RevenuePerformanceObligationPercentageOfNetSale" nillable="true" xbrli:periodType="instant" substitutionGroup="xbrli:item" type="xbrli:pureItemType"/>
  <xs:element id="xfor_IssuanceOnDecemberTwentyEightTwoThousandSeventeenOneMember" abstract="true" name="IssuanceOnDecemberTwentyEightTwoThousandSeventeenOneMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_A10NetSalesMember" abstract="true" name="A10NetSalesMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="xfor_ClassOfWarrantOrRightAggregateProceedsFromWarrantsIssued" abstract="false" name="ClassOfWarrantOrRightAggregateProceedsFromWarrantsIssued" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_IncreaseDecreaseInLeaseLiabilities" abstract="false" name="IncreaseDecreaseInLeaseLiabilities" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_IssuanceOnMarchThirteenTwoThousandNineteenMember" abstract="true" name="IssuanceOnMarchThirteenTwoThousandNineteenMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_AllstonLeaseMember" abstract="true" name="AllstonLeaseMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceOnMay192023Member" abstract="true" name="IssuanceOnMay192023Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="xfor_ResearchAndDevelopmentIncentiveProgramMember" abstract="true" name="ResearchAndDevelopmentIncentiveProgramMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_NumeratorAbstract" abstract="true" name="NumeratorAbstract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="xfor_CollaborativeArrangementRightsAndObligationsMaximumAggregateMilestonePaymentsPerProduct" abstract="false" name="CollaborativeArrangementRightsAndObligationsMaximumAggregateMilestonePaymentsPerProduct" nillable="true" xbrli:periodType="instant" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_ResearchAndDevelopmentIncentiveReceivable" abstract="false" name="ResearchAndDevelopmentIncentiveReceivable" nillable="true" xbrli:periodType="instant" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_LesseeOperatingLeaseLeaseNotYetCommencedOfficeSpace" abstract="false" name="LesseeOperatingLeaseLeaseNotYetCommencedOfficeSpace" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:areaItemType"/>
  <xs:element id="xfor_CollaborationLicenseAndFundingArrangementsTable" abstract="true" name="CollaborationLicenseAndFundingArrangementsTable" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrldt:hypercubeItem" type="xbrli:stringItemType"/>
  <xs:element id="xfor_ContingenciesAndCommitmentsLineItems" abstract="true" name="ContingenciesAndCommitmentsLineItems" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="xfor_DenominatorAbstract" abstract="true" name="DenominatorAbstract" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="xfor_ScheduleOfAccountingPoliciesTable" abstract="true" name="ScheduleOfAccountingPoliciesTable" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrldt:hypercubeItem" type="xbrli:stringItemType"/>
  <xs:element id="xfor_A12NetSalesMember" abstract="true" name="A12NetSalesMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types:domainItemType"/>
  <xs:element id="xfor_PrefundedWarrantsDomain" abstract="true" name="PrefundedWarrantsDomain" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_WalthamLeaseMember" abstract="true" name="WalthamLeaseMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_CollaborationLicenseAndFundingArrangementsLineItems" abstract="true" name="CollaborationLicenseAndFundingArrangementsLineItems" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="xbrli:stringItemType"/>
  <xs:element id="xfor_IssuanceOnOctoberNineteenTwoThousandEighteenMember" abstract="true" name="IssuanceOnOctoberNineteenTwoThousandEighteenMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_HerculesSecondAmendedLoanAgreementMember" abstract="true" name="HerculesSecondAmendedLoanAgreementMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_LabEquipmentMember" abstract="true" name="LabEquipmentMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceOnJuly620222Member" abstract="true" name="IssuanceOnJuly620222Member" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_AccruedExpensesTextBlock" abstract="false" name="AccruedExpensesTextBlock" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:textBlockItemType"/>
  <xs:element id="xfor_HerculesLoanAgreementMember" abstract="true" name="HerculesLoanAgreementMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_IssuanceOnNovemberTwentyNineTwoThousandNineteenOneMember" abstract="true" name="IssuanceOnNovemberTwentyNineTwoThousandNineteenOneMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_MilestonePayments" abstract="false" name="MilestonePayments" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_LesseeOperatingLeaseLeaseNotYetCommencedAmount" abstract="false" name="LesseeOperatingLeaseLeaseNotYetCommencedAmount" nillable="true" xbrli:periodType="duration" xbrli:balance="credit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_PrefundedWarrantsAxis" abstract="true" name="PrefundedWarrantsAxis" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrldt:dimensionItem" type="xbrli:stringItemType"/>
  <xs:element id="xfor_NonCashInterestExpense" abstract="false" name="NonCashInterestExpense" nillable="true" xbrli:periodType="duration" xbrli:balance="debit" substitutionGroup="xbrli:item" type="xbrli:monetaryItemType"/>
  <xs:element id="xfor_ViennaAustriaLeaseMember" abstract="true" name="ViennaAustriaLeaseMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
  <xs:element id="xfor_PreFundedWarrantMember" abstract="true" name="PreFundedWarrantMember" nillable="true" xbrli:periodType="duration" substitutionGroup="xbrli:item" type="dtr-types1:domainItemType"/>
</xs:schema>
