<?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-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xbrldt="http://xbrl.org/2005/xbrldt" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain"/>
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:type="simple" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member"/>
  <link:roleRef roleURI="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVELOSS" xlink:type="simple" xlink:href="xfor-20240331.xsd#CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVELOSS"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVELOSS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_6a8b2d89-c824-4aaf-a182-53b84b7da880" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_StatementTable_6a8b2d89-c824-4aaf-a182-53b84b7da880" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByLiabilityClassAxis_5d9a7125-ffe9-45a4-962c-811b128371ea" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByLiabilityClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_6a8b2d89-c824-4aaf-a182-53b84b7da880" xlink:to="loc_us-gaap_FairValueByLiabilityClassAxis_5d9a7125-ffe9-45a4-962c-811b128371ea" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_5d9a7125-ffe9-45a4-962c-811b128371ea_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_5d9a7125-ffe9-45a4-962c-811b128371ea" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_5d9a7125-ffe9-45a4-962c-811b128371ea_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_10f75c4a-a98b-47ba-9557-64d78470fa4a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_5d9a7125-ffe9-45a4-962c-811b128371ea" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_10f75c4a-a98b-47ba-9557-64d78470fa4a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFinancialInstrumentsLiabilitiesMember_69683b06-cc7b-4a6f-b498-f7e9c9ea7fa5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFinancialInstrumentsLiabilitiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_10f75c4a-a98b-47ba-9557-64d78470fa4a" xlink:to="loc_us-gaap_DerivativeFinancialInstrumentsLiabilitiesMember_69683b06-cc7b-4a6f-b498-f7e9c9ea7fa5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_WarrantLiabilityMember_098305b1-b1de-4649-af9c-2d39251cb421" xlink:href="xfor-20240331.xsd#xfor_WarrantLiabilityMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_10f75c4a-a98b-47ba-9557-64d78470fa4a" xlink:to="loc_xfor_WarrantLiabilityMember_098305b1-b1de-4649-af9c-2d39251cb421" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingExpensesAbstract_c12a2bad-c9ad-43a1-b9b6-e5377faf366d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingExpensesAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_OperatingExpensesAbstract_c12a2bad-c9ad-43a1-b9b6-e5377faf366d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpense_d617cab2-7c38-46d9-b7cc-f3f6d834ae87" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResearchAndDevelopmentExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingExpensesAbstract_c12a2bad-c9ad-43a1-b9b6-e5377faf366d" xlink:to="loc_us-gaap_ResearchAndDevelopmentExpense_d617cab2-7c38-46d9-b7cc-f3f6d834ae87" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GeneralAndAdministrativeExpense_518a311a-57fd-4ee1-9acb-39750121598d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_GeneralAndAdministrativeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingExpensesAbstract_c12a2bad-c9ad-43a1-b9b6-e5377faf366d" xlink:to="loc_us-gaap_GeneralAndAdministrativeExpense_518a311a-57fd-4ee1-9acb-39750121598d" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingExpenses_0e587e87-f5c9-4d22-a605-586f6a22de29" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingExpenses"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OperatingExpensesAbstract_c12a2bad-c9ad-43a1-b9b6-e5377faf366d" xlink:to="loc_us-gaap_OperatingExpenses_0e587e87-f5c9-4d22-a605-586f6a22de29" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingIncomeLoss_7e72595c-f25f-423e-b4c3-c9dab5d21b91" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_OperatingIncomeLoss_7e72595c-f25f-423e-b4c3-c9dab5d21b91" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpenseAbstract_a382d25e-a6c1-4652-a9e1-8333d8ab8c0a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NonoperatingIncomeExpenseAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_NonoperatingIncomeExpenseAbstract_a382d25e-a6c1-4652-a9e1-8333d8ab8c0a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInterest_018bcaa5-eb33-44fb-bcfa-f812624d9d66" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentIncomeInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NonoperatingIncomeExpenseAbstract_a382d25e-a6c1-4652-a9e1-8333d8ab8c0a" xlink:to="loc_us-gaap_InvestmentIncomeInterest_018bcaa5-eb33-44fb-bcfa-f812624d9d66" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_876b457a-7fe7-49f1-bc68-2ccffe3043a0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NonoperatingIncomeExpenseAbstract_a382d25e-a6c1-4652-a9e1-8333d8ab8c0a" xlink:to="loc_us-gaap_InterestExpense_876b457a-7fe7-49f1-bc68-2ccffe3043a0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeGainLossOnDerivativeNet_34a3a933-f3b9-4145-a5bf-e1333f1bce6a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeGainLossOnDerivativeNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NonoperatingIncomeExpenseAbstract_a382d25e-a6c1-4652-a9e1-8333d8ab8c0a" xlink:to="loc_us-gaap_DerivativeGainLossOnDerivativeNet_34a3a933-f3b9-4145-a5bf-e1333f1bce6a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_db0afdd9-a7d5-4931-ba29-62b562cdf450" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NonoperatingIncomeExpenseAbstract_a382d25e-a6c1-4652-a9e1-8333d8ab8c0a" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_db0afdd9-a7d5-4931-ba29-62b562cdf450" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NonoperatingIncomeExpense_1db604c0-dec7-406e-8a41-d30918e5155a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NonoperatingIncomeExpenseAbstract_a382d25e-a6c1-4652-a9e1-8333d8ab8c0a" xlink:to="loc_us-gaap_NonoperatingIncomeExpense_1db604c0-dec7-406e-8a41-d30918e5155a" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_95d1433a-974d-48a5-8feb-6b77cd8e4410" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_95d1433a-974d-48a5-8feb-6b77cd8e4410" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_f39680a0-8bee-4a23-8a30-3019ed7a026f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_f39680a0-8bee-4a23-8a30-3019ed7a026f" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_012473c7-8b0a-4180-8c2f-0409ee654a82" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_NetIncomeLoss_012473c7-8b0a-4180-8c2f-0409ee654a82" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasic_1725fa38-5fde-445a-8a0e-50ae09741ded" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EarningsPerShareBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_EarningsPerShareBasic_1725fa38-5fde-445a-8a0e-50ae09741ded" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareDiluted_a4c9d1d1-e513-4c5c-b6ca-f367ac63c574" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EarningsPerShareDiluted"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_EarningsPerShareDiluted_a4c9d1d1-e513-4c5c-b6ca-f367ac63c574" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_f5426512-c6fc-4008-b5f1-ebbda94d423e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_f5426512-c6fc-4008-b5f1-ebbda94d423e" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_7b9672ed-a944-4459-9ceb-41194e010577" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_7b9672ed-a944-4459-9ceb-41194e010577" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalIncomeStatementElementsAbstract_3daebb1d-d6b0-4583-81c4-77627074c9e0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SupplementalIncomeStatementElementsAbstract"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_595df947-c5f4-47f3-85dc-d1e94be53419" xlink:to="loc_us-gaap_SupplementalIncomeStatementElementsAbstract_3daebb1d-d6b0-4583-81c4-77627074c9e0" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_TemporaryEquityRepurchaseOfConvertiblePreferredStock_f7964b65-9681-4fc9-b665-a4dc731615bb" xlink:href="xfor-20240331.xsd#xfor_TemporaryEquityRepurchaseOfConvertiblePreferredStock"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SupplementalIncomeStatementElementsAbstract_3daebb1d-d6b0-4583-81c4-77627074c9e0" xlink:to="loc_xfor_TemporaryEquityRepurchaseOfConvertiblePreferredStock_f7964b65-9681-4fc9-b665-a4dc731615bb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_d5cc2994-188a-4493-b6c9-2fb603cae679" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SupplementalIncomeStatementElementsAbstract_3daebb1d-d6b0-4583-81c4-77627074c9e0" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTax_d5cc2994-188a-4493-b6c9-2fb603cae679" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCONVERTIBLEPREFERREDSTOCKREDEEMABLECOMMONSTOCKANDSTOCKHOLDERSEQUITYDEFICIT" xlink:type="simple" xlink:href="xfor-20240331.xsd#CONDENSEDCONSOLIDATEDSTATEMENTSOFCONVERTIBLEPREFERREDSTOCKREDEEMABLECOMMONSTOCKANDSTOCKHOLDERSEQUITYDEFICIT"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCONVERTIBLEPREFERREDSTOCKREDEEMABLECOMMONSTOCKANDSTOCKHOLDERSEQUITYDEFICIT" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementLineItems_590981f8-94a5-465e-9372-c238a8e1573f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementTable_2c766436-45ef-48ea-a26d-b4203f9d2b49" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_590981f8-94a5-465e-9372-c238a8e1573f" xlink:to="loc_us-gaap_StatementTable_2c766436-45ef-48ea-a26d-b4203f9d2b49" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_8af0312e-166f-461e-bd8f-7cd2c7e37ce6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_2c766436-45ef-48ea-a26d-b4203f9d2b49" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_8af0312e-166f-461e-bd8f-7cd2c7e37ce6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_8af0312e-166f-461e-bd8f-7cd2c7e37ce6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_8af0312e-166f-461e-bd8f-7cd2c7e37ce6" xlink:to="loc_us-gaap_EquityComponentDomain_8af0312e-166f-461e-bd8f-7cd2c7e37ce6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_b16e6be9-edb3-4f82-a9aa-1514bf975793" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_8af0312e-166f-461e-bd8f-7cd2c7e37ce6" xlink:to="loc_us-gaap_EquityComponentDomain_b16e6be9-edb3-4f82-a9aa-1514bf975793" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockMember_d8e3fbfb-6669-4974-976b-83cfb41a7758" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_b16e6be9-edb3-4f82-a9aa-1514bf975793" xlink:to="loc_us-gaap_CommonStockMember_d8e3fbfb-6669-4974-976b-83cfb41a7758" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember_356c3243-1809-4993-821a-583e3396dd6f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AdditionalPaidInCapitalMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_b16e6be9-edb3-4f82-a9aa-1514bf975793" xlink:to="loc_us-gaap_AdditionalPaidInCapitalMember_356c3243-1809-4993-821a-583e3396dd6f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_a202e7a1-5a56-4cb1-96c5-4f207861a664" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_b16e6be9-edb3-4f82-a9aa-1514bf975793" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_a202e7a1-5a56-4cb1-96c5-4f207861a664" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsMember_8402fa0c-1bc4-4aee-8653-fb7b4fd72ef3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RetainedEarningsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_b16e6be9-edb3-4f82-a9aa-1514bf975793" xlink:to="loc_us-gaap_RetainedEarningsMember_8402fa0c-1bc4-4aee-8653-fb7b4fd72ef3" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_590981f8-94a5-465e-9372-c238a8e1573f" xlink:to="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharesOutstanding_00f468b9-9eb1-4e44-a750-101fd598485e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharesOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_SharesOutstanding_00f468b9-9eb1-4e44-a750-101fd598485e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_6ba17d8f-981b-42a0-8cf3-507695c79c48" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockholdersEquity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_StockholdersEquity_6ba17d8f-981b-42a0-8cf3-507695c79c48" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardNetOfForfeitures_8314b5a5-3a9f-4ea8-8ebe-b378be879a61" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardNetOfForfeitures"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesRestrictedStockAwardNetOfForfeitures_8314b5a5-3a9f-4ea8-8ebe-b378be879a61" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueRestrictedStockAwardNetOfForfeitures_e9a5894b-1d0d-4489-a981-45c81749369c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockIssuedDuringPeriodValueRestrictedStockAwardNetOfForfeitures"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueRestrictedStockAwardNetOfForfeitures_e9a5894b-1d0d-4489-a981-45c81749369c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockSharesIssuedNetOfSharesForTaxWithholdings_a104bc15-7819-42a4-b189-b02bd6715095" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedStockSharesIssuedNetOfSharesForTaxWithholdings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_RestrictedStockSharesIssuedNetOfSharesForTaxWithholdings_a104bc15-7819-42a4-b189-b02bd6715095" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockValueSharesIssuedNetOfTaxWithholdings_df86d755-8e2e-4a23-8ca2-56294760e026" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedStockValueSharesIssuedNetOfTaxWithholdings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_RestrictedStockValueSharesIssuedNetOfTaxWithholdings_df86d755-8e2e-4a23-8ca2-56294760e026" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_2a1afad9-dbcc-4cf6-9784-fa1ddbb97727" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_2a1afad9-dbcc-4cf6-9784-fa1ddbb97727" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MarketableSecuritiesUnrealizedGainLoss_3f8f91e6-d030-4186-9e41-b5d601e0d8e6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MarketableSecuritiesUnrealizedGainLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_MarketableSecuritiesUnrealizedGainLoss_3f8f91e6-d030-4186-9e41-b5d601e0d8e6" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_bef4c9b6-d398-429d-a876-84683a84ed7d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetIncomeLoss"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_8cf7b08d-1056-4eab-9010-5ea19491edc5" xlink:to="loc_us-gaap_NetIncomeLoss_bef4c9b6-d398-429d-a876-84683a84ed7d" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharesOutstanding_c50e50df-d9a6-4b2f-9bfa-d4e2889fc880" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_573ec096-87ca-4b24-a4cb-c1e0d3a0bfa5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StockholdersEquity"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/NatureoftheBusinessandBasisofPresentationAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#NatureoftheBusinessandBasisofPresentationAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/NatureoftheBusinessandBasisofPresentationAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_BusinessAcquisitionLineItems_cb0ba241-df5c-4ef6-a6c6-312f297cdc2d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_BusinessAcquisitionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ScheduleOfAccountingPoliciesTable_7a0bec37-56d2-44c3-b76e-0747a6661102" xlink:href="xfor-20240331.xsd#xfor_ScheduleOfAccountingPoliciesTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_cb0ba241-df5c-4ef6-a6c6-312f297cdc2d" xlink:to="loc_xfor_ScheduleOfAccountingPoliciesTable_7a0bec37-56d2-44c3-b76e-0747a6661102" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_2f90d3fc-2048-4a0a-91ae-2267e10dfeff" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_ScheduleOfAccountingPoliciesTable_7a0bec37-56d2-44c3-b76e-0747a6661102" xlink:to="loc_us-gaap_CreditFacilityAxis_2f90d3fc-2048-4a0a-91ae-2267e10dfeff" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_2f90d3fc-2048-4a0a-91ae-2267e10dfeff_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_2f90d3fc-2048-4a0a-91ae-2267e10dfeff" xlink:to="loc_us-gaap_CreditFacilityDomain_2f90d3fc-2048-4a0a-91ae-2267e10dfeff_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_f229fd96-fcc4-4f0e-a7e7-e3299eafff3c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_2f90d3fc-2048-4a0a-91ae-2267e10dfeff" xlink:to="loc_us-gaap_CreditFacilityDomain_f229fd96-fcc4-4f0e-a7e7-e3299eafff3c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_MinCashTestDate1Member_38e78ec3-ff2c-4de3-8a5b-4eea00b87f04" xlink:href="xfor-20240331.xsd#xfor_MinCashTestDate1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_f229fd96-fcc4-4f0e-a7e7-e3299eafff3c" xlink:to="loc_xfor_MinCashTestDate1Member_38e78ec3-ff2c-4de3-8a5b-4eea00b87f04" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_3a306254-2575-45fe-9af9-05c312faa812" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_ScheduleOfAccountingPoliciesTable_7a0bec37-56d2-44c3-b76e-0747a6661102" xlink:to="loc_us-gaap_DebtInstrumentAxis_3a306254-2575-45fe-9af9-05c312faa812" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_3a306254-2575-45fe-9af9-05c312faa812_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_3a306254-2575-45fe-9af9-05c312faa812" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_3a306254-2575-45fe-9af9-05c312faa812_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_a660840e-e05e-42c1-87e1-1423cc16ceb4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_3a306254-2575-45fe-9af9-05c312faa812" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_a660840e-e05e-42c1-87e1-1423cc16ceb4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_HerculesSecondAmendedLoanAgreementMember_e1159542-4992-40c1-aa6e-8adfad8f5c39" xlink:href="xfor-20240331.xsd#xfor_HerculesSecondAmendedLoanAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_a660840e-e05e-42c1-87e1-1423cc16ceb4" xlink:to="loc_xfor_HerculesSecondAmendedLoanAgreementMember_e1159542-4992-40c1-aa6e-8adfad8f5c39" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsAndShortTermInvestments_84826a67-03ea-4b2d-b92d-bf117a0d9106" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CashCashEquivalentsAndShortTermInvestments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_cb0ba241-df5c-4ef6-a6c6-312f297cdc2d" xlink:to="loc_us-gaap_CashCashEquivalentsAndShortTermInvestments_84826a67-03ea-4b2d-b92d-bf117a0d9106" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_d9f71928-4f9e-445d-a9e4-10bb25713acd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_cb0ba241-df5c-4ef6-a6c6-312f297cdc2d" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_d9f71928-4f9e-445d-a9e4-10bb25713acd" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_904d6abc-f60a-4123-9b30-7b53d9815513" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_cb0ba241-df5c-4ef6-a6c6-312f297cdc2d" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_904d6abc-f60a-4123-9b30-7b53d9815513" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LineOfCreditCovenantMinimumCash_232b962c-b93f-43a9-94d9-c834185f6d26" xlink:href="xfor-20240331.xsd#xfor_LineOfCreditCovenantMinimumCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_BusinessAcquisitionLineItems_cb0ba241-df5c-4ef6-a6c6-312f297cdc2d" xlink:to="loc_xfor_LineOfCreditCovenantMinimumCash_232b962c-b93f-43a9-94d9-c834185f6d26" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesScheduleofCompensatingBalanceArrangementsDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#SummaryofSignificantAccountingPoliciesScheduleofCompensatingBalanceArrangementsDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/SummaryofSignificantAccountingPoliciesScheduleofCompensatingBalanceArrangementsDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsLineItems_a36912f9-9421-43d7-b0f1-9357dca466d2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CashAndCashEquivalentsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfCashAndCashEquivalentsTable_0accffde-fbd1-4b12-87c5-a56cc548b19d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfCashAndCashEquivalentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_a36912f9-9421-43d7-b0f1-9357dca466d2" xlink:to="loc_us-gaap_ScheduleOfCashAndCashEquivalentsTable_0accffde-fbd1-4b12-87c5-a56cc548b19d" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_e6a7c540-00e1-498d-8256-1c860f09abe7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfCashAndCashEquivalentsTable_0accffde-fbd1-4b12-87c5-a56cc548b19d" xlink:to="loc_us-gaap_CreditFacilityAxis_e6a7c540-00e1-498d-8256-1c860f09abe7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_e6a7c540-00e1-498d-8256-1c860f09abe7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_e6a7c540-00e1-498d-8256-1c860f09abe7" xlink:to="loc_us-gaap_CreditFacilityDomain_e6a7c540-00e1-498d-8256-1c860f09abe7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_9c8029c0-9fae-48d5-b0bf-50c54ad56233" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_e6a7c540-00e1-498d-8256-1c860f09abe7" xlink:to="loc_us-gaap_CreditFacilityDomain_9c8029c0-9fae-48d5-b0bf-50c54ad56233" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LetterOfCreditMember_d4cb6c87-f5dc-41c0-9fe3-0bf2ea627f42" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LetterOfCreditMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_9c8029c0-9fae-48d5-b0bf-50c54ad56233" xlink:to="loc_us-gaap_LetterOfCreditMember_d4cb6c87-f5dc-41c0-9fe3-0bf2ea627f42" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_6aad5dd2-0b68-4d85-a1f7-61d0e4a92752" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfCashAndCashEquivalentsTable_0accffde-fbd1-4b12-87c5-a56cc548b19d" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_6aad5dd2-0b68-4d85-a1f7-61d0e4a92752" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_6aad5dd2-0b68-4d85-a1f7-61d0e4a92752_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_6aad5dd2-0b68-4d85-a1f7-61d0e4a92752" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_6aad5dd2-0b68-4d85-a1f7-61d0e4a92752_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_08f07ca3-64a6-4c8a-ae1b-986dace43b42" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_6aad5dd2-0b68-4d85-a1f7-61d0e4a92752" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_08f07ca3-64a6-4c8a-ae1b-986dace43b42" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_WalthamLeaseMember_34367cc3-e3c7-45b5-9a07-08061d25e405" xlink:href="xfor-20240331.xsd#xfor_WalthamLeaseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_08f07ca3-64a6-4c8a-ae1b-986dace43b42" xlink:to="loc_xfor_WalthamLeaseMember_34367cc3-e3c7-45b5-9a07-08061d25e405" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ViennaLeaseAgreementMember_56bdc90d-9228-4a4d-ac73-c9e1344d89ff" xlink:href="xfor-20240331.xsd#xfor_ViennaLeaseAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_08f07ca3-64a6-4c8a-ae1b-986dace43b42" xlink:to="loc_xfor_ViennaLeaseAgreementMember_56bdc90d-9228-4a4d-ac73-c9e1344d89ff" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_AllstonLeaseAgreementMember_4f014dae-0bf8-4873-a413-6a56223bba7c" xlink:href="xfor-20240331.xsd#xfor_AllstonLeaseAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_08f07ca3-64a6-4c8a-ae1b-986dace43b42" xlink:to="loc_xfor_AllstonLeaseAgreementMember_4f014dae-0bf8-4873-a413-6a56223bba7c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedCash_8112ea1d-1525-4fdd-b56b-1f038b5092d3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_a36912f9-9421-43d7-b0f1-9357dca466d2" xlink:to="loc_us-gaap_RestrictedCash_8112ea1d-1525-4fdd-b56b-1f038b5092d3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedCashCurrent_01e6eb54-2cb9-4be6-89fd-69f5d1ac18a8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedCashCurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_a36912f9-9421-43d7-b0f1-9357dca466d2" xlink:to="loc_us-gaap_RestrictedCashCurrent_01e6eb54-2cb9-4be6-89fd-69f5d1ac18a8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedCashNoncurrent_228bdb36-4d0c-43f0-8c0d-d4eaf90be6eb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedCashNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CashAndCashEquivalentsLineItems_a36912f9-9421-43d7-b0f1-9357dca466d2" xlink:to="loc_us-gaap_RestrictedCashNoncurrent_228bdb36-4d0c-43f0-8c0d-d4eaf90be6eb" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LicenseCollaborationandFundingAgreementsAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#LicenseCollaborationandFundingAgreementsAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/LicenseCollaborationandFundingAgreementsAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:href="xfor-20240331.xsd#xfor_CollaborationLicenseAndFundingArrangementsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_CollaborationLicenseAndFundingArrangementsTable_605c0911-fe98-4ff8-b1af-3a21267c66ac" xlink:href="xfor-20240331.xsd#xfor_CollaborationLicenseAndFundingArrangementsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:to="loc_xfor_CollaborationLicenseAndFundingArrangementsTable_605c0911-fe98-4ff8-b1af-3a21267c66ac" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfArrangementAxis_dcb355fe-3891-4c8b-b50c-a0ac2e69a9d6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TypeOfArrangementAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsTable_605c0911-fe98-4ff8-b1af-3a21267c66ac" xlink:to="loc_us-gaap_TypeOfArrangementAxis_dcb355fe-3891-4c8b-b50c-a0ac2e69a9d6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_dcb355fe-3891-4c8b-b50c-a0ac2e69a9d6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ArrangementsAndNonarrangementTransactionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_TypeOfArrangementAxis_dcb355fe-3891-4c8b-b50c-a0ac2e69a9d6" xlink:to="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_dcb355fe-3891-4c8b-b50c-a0ac2e69a9d6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_ef4b503e-b006-4e74-a6f5-f0988e77eb0c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ArrangementsAndNonarrangementTransactionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_TypeOfArrangementAxis_dcb355fe-3891-4c8b-b50c-a0ac2e69a9d6" xlink:to="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_ef4b503e-b006-4e74-a6f5-f0988e77eb0c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ResearchAndDevelopmentIncentiveProgramMember_b6b46046-4e88-4311-a74e-c1197783f891" xlink:href="xfor-20240331.xsd#xfor_ResearchAndDevelopmentIncentiveProgramMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_ef4b503e-b006-4e74-a6f5-f0988e77eb0c" xlink:to="loc_xfor_ResearchAndDevelopmentIncentiveProgramMember_b6b46046-4e88-4311-a74e-c1197783f891" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_GenzymeAgreementMember_8bd91509-6bc2-471d-9ebb-193ca73b178a" xlink:href="xfor-20240331.xsd#xfor_GenzymeAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_ef4b503e-b006-4e74-a6f5-f0988e77eb0c" xlink:to="loc_xfor_GenzymeAgreementMember_8bd91509-6bc2-471d-9ebb-193ca73b178a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_CounterpartyNameAxis_ccb3d913-8213-4519-a535-510f865d51c9" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_CounterpartyNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsTable_605c0911-fe98-4ff8-b1af-3a21267c66ac" xlink:to="loc_srt_CounterpartyNameAxis_ccb3d913-8213-4519-a535-510f865d51c9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_ccb3d913-8213-4519-a535-510f865d51c9_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_ccb3d913-8213-4519-a535-510f865d51c9" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_ccb3d913-8213-4519-a535-510f865d51c9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cb0d8c23-6b3a-43ac-9740-21724efca513" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RepurchaseAgreementCounterpartyNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_ccb3d913-8213-4519-a535-510f865d51c9" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cb0d8c23-6b3a-43ac-9740-21724efca513" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_A6NetSalesMember_f18237a1-9a84-4295-a5fd-cfc93d64ad4d" xlink:href="xfor-20240331.xsd#xfor_A6NetSalesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cb0d8c23-6b3a-43ac-9740-21724efca513" xlink:to="loc_xfor_A6NetSalesMember_f18237a1-9a84-4295-a5fd-cfc93d64ad4d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_A10NetSalesMember_273f41e5-5fcb-49fd-9c2b-34d42c3f2a53" xlink:href="xfor-20240331.xsd#xfor_A10NetSalesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cb0d8c23-6b3a-43ac-9740-21724efca513" xlink:to="loc_xfor_A10NetSalesMember_273f41e5-5fcb-49fd-9c2b-34d42c3f2a53" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_A12NetSalesMember_976584ae-3bc3-457c-99f4-85034eace6a2" xlink:href="xfor-20240331.xsd#xfor_A12NetSalesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_cb0d8c23-6b3a-43ac-9740-21724efca513" xlink:to="loc_xfor_A12NetSalesMember_976584ae-3bc3-457c-99f4-85034eace6a2" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_b122a3ad-9e9d-461a-9633-29b0fd2427b6" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsTable_605c0911-fe98-4ff8-b1af-3a21267c66ac" xlink:to="loc_srt_RangeAxis_b122a3ad-9e9d-461a-9633-29b0fd2427b6" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_b122a3ad-9e9d-461a-9633-29b0fd2427b6_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_b122a3ad-9e9d-461a-9633-29b0fd2427b6" xlink:to="loc_srt_RangeMember_b122a3ad-9e9d-461a-9633-29b0fd2427b6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_3123ad47-7113-4f83-b25f-14737c439342" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_b122a3ad-9e9d-461a-9633-29b0fd2427b6" xlink:to="loc_srt_RangeMember_3123ad47-7113-4f83-b25f-14737c439342" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MinimumMember_a9e25ae2-8726-4e7b-b6cc-cee0ecbeeabb" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MinimumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_3123ad47-7113-4f83-b25f-14737c439342" xlink:to="loc_srt_MinimumMember_a9e25ae2-8726-4e7b-b6cc-cee0ecbeeabb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_e4b846c6-4feb-435a-b326-8194c1829f67" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_3123ad47-7113-4f83-b25f-14737c439342" xlink:to="loc_srt_MaximumMember_e4b846c6-4feb-435a-b326-8194c1829f67" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_GrantAndIncentiveReceivables_6fce458d-7ee6-4fee-be0a-c0a83d564ee8" xlink:href="xfor-20240331.xsd#xfor_GrantAndIncentiveReceivables"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:to="loc_xfor_GrantAndIncentiveReceivables_6fce458d-7ee6-4fee-be0a-c0a83d564ee8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_24263c69-f983-43cb-8c9e-597e72bd892f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OtherNonoperatingIncomeExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_24263c69-f983-43cb-8c9e-597e72bd892f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_MilestonePayments_fda63774-8379-4d51-8378-1eb922ea0dd8" xlink:href="xfor-20240331.xsd#xfor_MilestonePayments"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:to="loc_xfor_MilestonePayments_fda63774-8379-4d51-8378-1eb922ea0dd8" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_CollaborativeArrangementRightsAndObligationsMaximumAggregateMilestonePaymentsPerProduct_e3f801d3-5bbf-4ce5-a22e-1499a0438a86" xlink:href="xfor-20240331.xsd#xfor_CollaborativeArrangementRightsAndObligationsMaximumAggregateMilestonePaymentsPerProduct"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:to="loc_xfor_CollaborativeArrangementRightsAndObligationsMaximumAggregateMilestonePaymentsPerProduct_e3f801d3-5bbf-4ce5-a22e-1499a0438a86" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_RevenuePerformanceObligationPercentageOfNetSale_d12f4e20-ae32-40e5-8e3e-300ad0b5afbf" xlink:href="xfor-20240331.xsd#xfor_RevenuePerformanceObligationPercentageOfNetSale"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:to="loc_xfor_RevenuePerformanceObligationPercentageOfNetSale_d12f4e20-ae32-40e5-8e3e-300ad0b5afbf" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RevenueFromCollaborativeArrangementExcludingRevenueFromContractWithCustomer_e5c2d8a6-5b26-4bf4-a39b-24d8f319b6c1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RevenueFromCollaborativeArrangementExcludingRevenueFromContractWithCustomer"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_CollaborationLicenseAndFundingArrangementsLineItems_0fdc2d81-cb4b-4d39-9494-b948927300ae" xlink:to="loc_us-gaap_RevenueFromCollaborativeArrangementExcludingRevenueFromContractWithCustomer_e5c2d8a6-5b26-4bf4-a39b-24d8f319b6c1" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesScheduleofAssetsandLiabilitiesMeasuredatFairValueDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#FairValueofFinancialAssetsandLiabilitiesScheduleofAssetsandLiabilitiesMeasuredatFairValueDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesScheduleofAssetsandLiabilitiesMeasuredatFairValueDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_51e719a7-4e7f-4ca8-b72d-b5aac2e9214a" xlink:href="xfor-20240331.xsd#xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_42718d00-008b-4e40-ba39-fdd944aa895d" xlink:href="xfor-20240331.xsd#xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_51e719a7-4e7f-4ca8-b72d-b5aac2e9214a" xlink:to="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_42718d00-008b-4e40-ba39-fdd944aa895d" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_b957085b-8fc6-4276-b2e0-04a121eaaf0d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByMeasurementFrequencyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_42718d00-008b-4e40-ba39-fdd944aa895d" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_b957085b-8fc6-4276-b2e0-04a121eaaf0d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_b957085b-8fc6-4276-b2e0-04a121eaaf0d_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_b957085b-8fc6-4276-b2e0-04a121eaaf0d" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_b957085b-8fc6-4276-b2e0-04a121eaaf0d_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_8c329814-730f-4fcd-8cc0-986bebaaa7c4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementFrequencyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_b957085b-8fc6-4276-b2e0-04a121eaaf0d" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_8c329814-730f-4fcd-8cc0-986bebaaa7c4" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember_2c448ab2-09dc-4d7e-8775-6b9a52bbc642" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsRecurringMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain_8c329814-730f-4fcd-8cc0-986bebaaa7c4" xlink:to="loc_us-gaap_FairValueMeasurementsRecurringMember_2c448ab2-09dc-4d7e-8775-6b9a52bbc642" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8c91d9cf-7fe9-4ef6-a9d9-19d5ae268e6a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_42718d00-008b-4e40-ba39-fdd944aa895d" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8c91d9cf-7fe9-4ef6-a9d9-19d5ae268e6a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8c91d9cf-7fe9-4ef6-a9d9-19d5ae268e6a_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8c91d9cf-7fe9-4ef6-a9d9-19d5ae268e6a" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8c91d9cf-7fe9-4ef6-a9d9-19d5ae268e6a_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_eeb66843-8ff4-4c2c-98b2-6e00bd3d82de" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_8c91d9cf-7fe9-4ef6-a9d9-19d5ae268e6a" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_eeb66843-8ff4-4c2c-98b2-6e00bd3d82de" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_589d28f0-0558-436e-a1bd-4a31b9a681c3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_eeb66843-8ff4-4c2c-98b2-6e00bd3d82de" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_589d28f0-0558-436e-a1bd-4a31b9a681c3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_647897f5-eb84-4341-b055-a685466a6aa1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel2Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_eeb66843-8ff4-4c2c-98b2-6e00bd3d82de" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_647897f5-eb84-4341-b055-a685466a6aa1" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_66bcebee-b671-40f2-91e8-1de275604c4a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueInputsLevel3Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_eeb66843-8ff4-4c2c-98b2-6e00bd3d82de" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_66bcebee-b671-40f2-91e8-1de275604c4a" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueByLiabilityClassAxis_07b80902-ffdb-4d41-bce9-5f7977ae1942" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueByLiabilityClassAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_42718d00-008b-4e40-ba39-fdd944aa895d" xlink:to="loc_us-gaap_FairValueByLiabilityClassAxis_07b80902-ffdb-4d41-bce9-5f7977ae1942" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_07b80902-ffdb-4d41-bce9-5f7977ae1942_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_07b80902-ffdb-4d41-bce9-5f7977ae1942" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_07b80902-ffdb-4d41-bce9-5f7977ae1942_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_fc14591f-04d7-4f1a-86fa-42003c75da7c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_07b80902-ffdb-4d41-bce9-5f7977ae1942" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_fc14591f-04d7-4f1a-86fa-42003c75da7c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeFinancialInstrumentsLiabilitiesMember_d9b70e97-bd11-4c3e-9fb2-67bdeb4fd8e0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeFinancialInstrumentsLiabilitiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_fc14591f-04d7-4f1a-86fa-42003c75da7c" xlink:to="loc_us-gaap_DerivativeFinancialInstrumentsLiabilitiesMember_d9b70e97-bd11-4c3e-9fb2-67bdeb4fd8e0" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantMember_ed04732b-3417-44c5-8545-991771e395da" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_fc14591f-04d7-4f1a-86fa-42003c75da7c" xlink:to="loc_us-gaap_WarrantMember_ed04732b-3417-44c5-8545-991771e395da" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeAxis_36f64099-c8b8-4393-9518-649ace6fc179" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_42718d00-008b-4e40-ba39-fdd944aa895d" xlink:to="loc_us-gaap_InvestmentTypeAxis_36f64099-c8b8-4393-9518-649ace6fc179" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeCategorizationMember_36f64099-c8b8-4393-9518-649ace6fc179_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeCategorizationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_InvestmentTypeAxis_36f64099-c8b8-4393-9518-649ace6fc179" xlink:to="loc_us-gaap_InvestmentTypeCategorizationMember_36f64099-c8b8-4393-9518-649ace6fc179_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentTypeCategorizationMember_cf50c72d-9913-43ed-983f-3b35e472df94" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InvestmentTypeCategorizationMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_InvestmentTypeAxis_36f64099-c8b8-4393-9518-649ace6fc179" xlink:to="loc_us-gaap_InvestmentTypeCategorizationMember_cf50c72d-9913-43ed-983f-3b35e472df94" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MoneyMarketFundsMember_ddfb7ab0-1fc1-425d-8769-3d40b10e011c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MoneyMarketFundsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_cf50c72d-9913-43ed-983f-3b35e472df94" xlink:to="loc_us-gaap_MoneyMarketFundsMember_ddfb7ab0-1fc1-425d-8769-3d40b10e011c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasuryBillSecuritiesMember_299850ad-8a85-439b-8518-8e313b25f55f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USTreasuryBillSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_InvestmentTypeCategorizationMember_cf50c72d-9913-43ed-983f-3b35e472df94" xlink:to="loc_us-gaap_USTreasuryBillSecuritiesMember_299850ad-8a85-439b-8518-8e313b25f55f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_ba89b626-6e3f-41d8-9126-b00cf6ae33d9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CashAndCashEquivalentsFairValueDisclosure"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_51e719a7-4e7f-4ca8-b72d-b5aac2e9214a" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_ba89b626-6e3f-41d8-9126-b00cf6ae33d9" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_0a3f9fcb-030b-4d41-9170-57c5cbcc4e1b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_51e719a7-4e7f-4ca8-b72d-b5aac2e9214a" xlink:to="loc_us-gaap_DerivativeLiabilities_0a3f9fcb-030b-4d41-9170-57c5cbcc4e1b" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesDebtSecuritiesAvailableforSaleDetails" xlink:type="simple" xlink:href="xfor-20240331.xsd#FairValueofFinancialAssetsandLiabilitiesDebtSecuritiesAvailableforSaleDetails"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesDebtSecuritiesAvailableforSaleDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8d3cfcf8-ff9b-43cf-81b9-ed79e2e01ffb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_c401def2-0096-4e92-8096-16559ca5482c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8d3cfcf8-ff9b-43cf-81b9-ed79e2e01ffb" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_c401def2-0096-4e92-8096-16559ca5482c" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_2a0f7769-c5ae-4b1a-969f-d65ac2f7c883" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_c401def2-0096-4e92-8096-16559ca5482c" xlink:to="loc_us-gaap_FinancialInstrumentAxis_2a0f7769-c5ae-4b1a-969f-d65ac2f7c883" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2a0f7769-c5ae-4b1a-969f-d65ac2f7c883_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_2a0f7769-c5ae-4b1a-969f-d65ac2f7c883" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2a0f7769-c5ae-4b1a-969f-d65ac2f7c883_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_054a7e5b-b83a-4e69-8391-272f753fee2e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_2a0f7769-c5ae-4b1a-969f-d65ac2f7c883" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_054a7e5b-b83a-4e69-8391-272f753fee2e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USTreasurySecuritiesMember_4776d700-3642-4398-94ea-da6ab11b4240" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USTreasurySecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_054a7e5b-b83a-4e69-8391-272f753fee2e" xlink:to="loc_us-gaap_USTreasurySecuritiesMember_4776d700-3642-4398-94ea-da6ab11b4240" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_USGovernmentCorporationsAndAgenciesSecuritiesMember_ca4fb9cd-341c-490e-b1df-0f8135b5667d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_USGovernmentCorporationsAndAgenciesSecuritiesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_054a7e5b-b83a-4e69-8391-272f753fee2e" xlink:to="loc_us-gaap_USGovernmentCorporationsAndAgenciesSecuritiesMember_ca4fb9cd-341c-490e-b1df-0f8135b5667d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_e488bb95-5f94-4798-a8fe-e258335132ef" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8d3cfcf8-ff9b-43cf-81b9-ed79e2e01ffb" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_e488bb95-5f94-4798-a8fe-e258335132ef" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_2295e8ce-ba3a-44fd-9d71-9099d7da0cc8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8d3cfcf8-ff9b-43cf-81b9-ed79e2e01ffb" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_2295e8ce-ba3a-44fd-9d71-9099d7da0cc8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_53c96597-1e2c-45f3-b658-7cb2f34d0dfe" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8d3cfcf8-ff9b-43cf-81b9-ed79e2e01ffb" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_53c96597-1e2c-45f3-b658-7cb2f34d0dfe" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_dabb559e-e0f9-4c6d-92e1-54c45de7634c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_8d3cfcf8-ff9b-43cf-81b9-ed79e2e01ffb" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_dabb559e-e0f9-4c6d-92e1-54c45de7634c" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesAggregateFairValuesFinancialInstrumentsDetails" xlink:type="simple" xlink:href="xfor-20240331.xsd#FairValueofFinancialAssetsandLiabilitiesAggregateFairValuesFinancialInstrumentsDetails"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesAggregateFairValuesFinancialInstrumentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_87a13548-0706-4ad5-8a08-3f7cc0e80f62" xlink:href="xfor-20240331.xsd#xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_b7bf5867-89dc-4b07-8ac8-5a1162f22019" xlink:href="xfor-20240331.xsd#xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_87a13548-0706-4ad5-8a08-3f7cc0e80f62" xlink:to="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_b7bf5867-89dc-4b07-8ac8-5a1162f22019" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FinancialInstrumentAxis_92b98794-fd9a-4afd-8b57-6df26e49dbab" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FinancialInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_b7bf5867-89dc-4b07-8ac8-5a1162f22019" xlink:to="loc_us-gaap_FinancialInstrumentAxis_92b98794-fd9a-4afd-8b57-6df26e49dbab" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_92b98794-fd9a-4afd-8b57-6df26e49dbab_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_92b98794-fd9a-4afd-8b57-6df26e49dbab" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_92b98794-fd9a-4afd-8b57-6df26e49dbab_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_1cd21ef8-2ec3-490f-808e-cb3dbe0e6079" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_92b98794-fd9a-4afd-8b57-6df26e49dbab" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_1cd21ef8-2ec3-490f-808e-cb3dbe0e6079" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmbeddedDerivativeFinancialInstrumentsMember_25bbb6bc-2577-4ee9-91b6-c34f7c5922bc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmbeddedDerivativeFinancialInstrumentsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_1cd21ef8-2ec3-490f-808e-cb3dbe0e6079" xlink:to="loc_us-gaap_EmbeddedDerivativeFinancialInstrumentsMember_25bbb6bc-2577-4ee9-91b6-c34f7c5922bc" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantMember_55593b44-3c70-4fe4-9c7d-65b7c2f04d6a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_1cd21ef8-2ec3-490f-808e-cb3dbe0e6079" xlink:to="loc_us-gaap_WarrantMember_55593b44-3c70-4fe4-9c7d-65b7c2f04d6a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_9a69ef2a-4ab0-4a9c-8c0b-160b0709f37e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_87a13548-0706-4ad5-8a08-3f7cc0e80f62" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_9a69ef2a-4ab0-4a9c-8c0b-160b0709f37e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_87013024-f493-4f3b-99d9-150886357094" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_9a69ef2a-4ab0-4a9c-8c0b-160b0709f37e" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_87013024-f493-4f3b-99d9-150886357094" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings_d572eb42-54fd-40ec-8b5d-5a1d26abbfc4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_9a69ef2a-4ab0-4a9c-8c0b-160b0709f37e" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings_d572eb42-54fd-40ec-8b5d-5a1d26abbfc4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_1efb6530-1d46-41c9-9b9d-6b6a1a6a7419" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesNarrativeDetails" xlink:type="simple" xlink:href="xfor-20240331.xsd#FairValueofFinancialAssetsandLiabilitiesNarrativeDetails"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_389e7108-e7ba-4319-8b86-640fa377daea" xlink:href="xfor-20240331.xsd#xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_e0b54bcf-7015-4ecd-818a-aeef0da85b4b" xlink:href="xfor-20240331.xsd#xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_389e7108-e7ba-4319-8b86-640fa377daea" xlink:to="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_e0b54bcf-7015-4ecd-818a-aeef0da85b4b" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MeasurementInputTypeAxis_9a7096fa-89f9-4d39-89df-e58322fe5a0b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MeasurementInputTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisTable_e0b54bcf-7015-4ecd-818a-aeef0da85b4b" xlink:to="loc_us-gaap_MeasurementInputTypeAxis_9a7096fa-89f9-4d39-89df-e58322fe5a0b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MeasurementInputTypeDomain_9a7096fa-89f9-4d39-89df-e58322fe5a0b_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MeasurementInputTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_MeasurementInputTypeAxis_9a7096fa-89f9-4d39-89df-e58322fe5a0b" xlink:to="loc_us-gaap_MeasurementInputTypeDomain_9a7096fa-89f9-4d39-89df-e58322fe5a0b_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MeasurementInputTypeDomain_87c1578b-8e01-4887-a5ba-d98cd1b7b441" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MeasurementInputTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_MeasurementInputTypeAxis_9a7096fa-89f9-4d39-89df-e58322fe5a0b" xlink:to="loc_us-gaap_MeasurementInputTypeDomain_87c1578b-8e01-4887-a5ba-d98cd1b7b441" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_MeasurementInputDiscountRateMember_628f3a7b-795d-4171-9da6-0f409fcdcafa" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_MeasurementInputDiscountRateMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_87c1578b-8e01-4887-a5ba-d98cd1b7b441" xlink:to="loc_us-gaap_MeasurementInputDiscountRateMember_628f3a7b-795d-4171-9da6-0f409fcdcafa" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DerivativeLiabilities_111ccce9-5f9b-44fb-9dc9-1144c6be4e9b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DerivativeLiabilities"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_FairValueAssetsAndLiabilitiesMeasuredOnRecurringBasisLineItems_389e7108-e7ba-4319-8b86-640fa377daea" xlink:to="loc_us-gaap_DerivativeLiabilities_111ccce9-5f9b-44fb-9dc9-1144c6be4e9b" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesFairValueAssumptionsDetails" xlink:type="simple" xlink:href="xfor-20240331.xsd#FairValueofFinancialAssetsandLiabilitiesFairValueAssumptionsDetails"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/FairValueofFinancialAssetsandLiabilitiesFairValueAssumptionsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_ade55f1d-434a-4835-8603-2b2ba9401dfa" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_ade55f1d-434a-4835-8603-2b2ba9401dfa" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_9974c17f-5490-42a4-9c72-c30161ccc201" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_ade55f1d-434a-4835-8603-2b2ba9401dfa" xlink:to="loc_us-gaap_AwardTypeAxis_9974c17f-5490-42a4-9c72-c30161ccc201" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_9974c17f-5490-42a4-9c72-c30161ccc201_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_9974c17f-5490-42a4-9c72-c30161ccc201" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_9974c17f-5490-42a4-9c72-c30161ccc201_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_88414270-fd03-4581-8fff-e66c215a0a06" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_9974c17f-5490-42a4-9c72-c30161ccc201" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_88414270-fd03-4581-8fff-e66c215a0a06" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantMember_e1baeacf-c583-492a-b5f5-5254b6f0179b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_88414270-fd03-4581-8fff-e66c215a0a06" xlink:to="loc_us-gaap_WarrantMember_e1baeacf-c583-492a-b5f5-5254b6f0179b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharePrice_0cae90b0-7533-48e0-ba79-b5d3c89e9626" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharePrice"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:to="loc_us-gaap_SharePrice_0cae90b0-7533-48e0-ba79-b5d3c89e9626" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_a3e486ff-18e9-412a-9f67-352f12eecf53" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_a3e486ff-18e9-412a-9f67-352f12eecf53" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_6f5ae687-382f-415f-b076-8644e437da45" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_6f5ae687-382f-415f-b076-8644e437da45" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_237b6438-622e-4638-a30c-4521de15602a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_237b6438-622e-4638-a30c-4521de15602a" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_591203d3-fe46-4025-8f0a-ea8ee86a75f6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_591203d3-fe46-4025-8f0a-ea8ee86a75f6" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_6c10ce0d-578a-4437-923b-6b613de82593" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_80ac52cc-e1a2-4d0f-8c50-59d13b60cac1" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_6c10ce0d-578a-4437-923b-6b613de82593" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/PropertyandEquipmentNetScheduleofPropertyandEquipmentNetDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#PropertyandEquipmentNetScheduleofPropertyandEquipmentNetDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/PropertyandEquipmentNetScheduleofPropertyandEquipmentNetDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentLineItems_a9677f1d-ad50-4000-b617-ac7baf99b842" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_b4a7d96e-bc0f-4b42-a2c5-41cf3ef3a6a5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_a9677f1d-ad50-4000-b617-ac7baf99b842" xlink:to="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_b4a7d96e-bc0f-4b42-a2c5-41cf3ef3a6a5" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_25a2b741-f5a4-4fce-9884-c820424888e6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_b4a7d96e-bc0f-4b42-a2c5-41cf3ef3a6a5" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_25a2b741-f5a4-4fce-9884-c820424888e6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_25a2b741-f5a4-4fce-9884-c820424888e6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_25a2b741-f5a4-4fce-9884-c820424888e6" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_25a2b741-f5a4-4fce-9884-c820424888e6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_0f3b7c3f-735e-46a2-a488-e5c3802e4633" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_25a2b741-f5a4-4fce-9884-c820424888e6" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_0f3b7c3f-735e-46a2-a488-e5c3802e4633" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LeaseholdImprovementsMember_acc38ebb-93f8-48f8-a5e0-444d3472c4e3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LeaseholdImprovementsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_0f3b7c3f-735e-46a2-a488-e5c3802e4633" xlink:to="loc_us-gaap_LeaseholdImprovementsMember_acc38ebb-93f8-48f8-a5e0-444d3472c4e3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FurnitureAndFixturesMember_2e15b71e-c8e6-42cb-9817-c32ca025c70c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_FurnitureAndFixturesMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_0f3b7c3f-735e-46a2-a488-e5c3802e4633" xlink:to="loc_us-gaap_FurnitureAndFixturesMember_2e15b71e-c8e6-42cb-9817-c32ca025c70c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComputerEquipmentMember_c40c0274-1b17-4432-b550-04d63f546acf" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ComputerEquipmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_0f3b7c3f-735e-46a2-a488-e5c3802e4633" xlink:to="loc_us-gaap_ComputerEquipmentMember_c40c0274-1b17-4432-b550-04d63f546acf" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_SoftwareMember_e0351d19-1dbe-467c-90b6-cd02c3708115" xlink:href="xfor-20240331.xsd#xfor_SoftwareMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_0f3b7c3f-735e-46a2-a488-e5c3802e4633" xlink:to="loc_xfor_SoftwareMember_e0351d19-1dbe-467c-90b6-cd02c3708115" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LabEquipmentMember_4508168a-c0e8-4e27-89c1-8e63e5d2c80c" xlink:href="xfor-20240331.xsd#xfor_LabEquipmentMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_0f3b7c3f-735e-46a2-a488-e5c3802e4633" xlink:to="loc_xfor_LabEquipmentMember_4508168a-c0e8-4e27-89c1-8e63e5d2c80c" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_83bbaf68-06e2-4e49-ad8d-8838cf53f707" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentGross"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_a9677f1d-ad50-4000-b617-ac7baf99b842" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_83bbaf68-06e2-4e49-ad8d-8838cf53f707" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_653fba48-9bf7-46b4-a487-7341d3cdbffc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_a9677f1d-ad50-4000-b617-ac7baf99b842" xlink:to="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_653fba48-9bf7-46b4-a487-7341d3cdbffc" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_b6dda1ad-ab6a-4f98-a4f2-f5fd684c7426" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_a9677f1d-ad50-4000-b617-ac7baf99b842" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_b6dda1ad-ab6a-4f98-a4f2-f5fd684c7426" xlink:type="arc" order="2"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LongTermDebtHerculesLoanAgreementAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#LongTermDebtHerculesLoanAgreementAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/LongTermDebtHerculesLoanAgreementAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_e1d675f1-71a0-49fe-9650-685779e64cc6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:to="loc_us-gaap_DebtInstrumentAxis_e1d675f1-71a0-49fe-9650-685779e64cc6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_e1d675f1-71a0-49fe-9650-685779e64cc6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_e1d675f1-71a0-49fe-9650-685779e64cc6" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_e1d675f1-71a0-49fe-9650-685779e64cc6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_6a4cb99c-ad32-4574-b64f-b68c35a54226" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_e1d675f1-71a0-49fe-9650-685779e64cc6" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_6a4cb99c-ad32-4574-b64f-b68c35a54226" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_HerculesLoanAgreementMember_b59fd758-3750-496d-b73b-eea2079ec9ca" xlink:href="xfor-20240331.xsd#xfor_HerculesLoanAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_6a4cb99c-ad32-4574-b64f-b68c35a54226" xlink:to="loc_xfor_HerculesLoanAgreementMember_b59fd758-3750-496d-b73b-eea2079ec9ca" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_HerculesSecondAmendedLoanAgreementMember_8f9762d3-6e0d-4b06-bce3-83138b2a7ad3" xlink:href="xfor-20240331.xsd#xfor_HerculesSecondAmendedLoanAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_6a4cb99c-ad32-4574-b64f-b68c35a54226" xlink:to="loc_xfor_HerculesSecondAmendedLoanAgreementMember_8f9762d3-6e0d-4b06-bce3-83138b2a7ad3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VariableRateAxis_89bbad28-126c-4206-8a03-42c1122428e2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VariableRateAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:to="loc_us-gaap_VariableRateAxis_89bbad28-126c-4206-8a03-42c1122428e2" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VariableRateDomain_89bbad28-126c-4206-8a03-42c1122428e2_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VariableRateDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_VariableRateAxis_89bbad28-126c-4206-8a03-42c1122428e2" xlink:to="loc_us-gaap_VariableRateDomain_89bbad28-126c-4206-8a03-42c1122428e2_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VariableRateDomain_36601720-9245-4c57-8d20-f091139d04aa" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VariableRateDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_VariableRateAxis_89bbad28-126c-4206-8a03-42c1122428e2" xlink:to="loc_us-gaap_VariableRateDomain_36601720-9245-4c57-8d20-f091139d04aa" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrimeRateMember_d0934366-23c7-439d-8e81-79c8fad8ffe8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PrimeRateMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VariableRateDomain_36601720-9245-4c57-8d20-f091139d04aa" xlink:to="loc_us-gaap_PrimeRateMember_d0934366-23c7-439d-8e81-79c8fad8ffe8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_423fd781-c2b0-42f9-844d-73be8a743090" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:to="loc_srt_RangeAxis_423fd781-c2b0-42f9-844d-73be8a743090" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_423fd781-c2b0-42f9-844d-73be8a743090_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_423fd781-c2b0-42f9-844d-73be8a743090" xlink:to="loc_srt_RangeMember_423fd781-c2b0-42f9-844d-73be8a743090_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_2f8f2980-43b7-4ade-b3a5-3ff2fee20697" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_423fd781-c2b0-42f9-844d-73be8a743090" xlink:to="loc_srt_RangeMember_2f8f2980-43b7-4ade-b3a5-3ff2fee20697" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_1865780a-f635-4042-bb7d-066550fe1eb8" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_2f8f2980-43b7-4ade-b3a5-3ff2fee20697" xlink:to="loc_srt_MaximumMember_1865780a-f635-4042-bb7d-066550fe1eb8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityAxis_1db12029-63e8-4eab-ac90-d84fac61a787" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:to="loc_us-gaap_CreditFacilityAxis_1db12029-63e8-4eab-ac90-d84fac61a787" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_1db12029-63e8-4eab-ac90-d84fac61a787_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_1db12029-63e8-4eab-ac90-d84fac61a787" xlink:to="loc_us-gaap_CreditFacilityDomain_1db12029-63e8-4eab-ac90-d84fac61a787_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CreditFacilityDomain_78bbb4d3-f321-44c2-8716-3063691447d8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CreditFacilityDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_1db12029-63e8-4eab-ac90-d84fac61a787" xlink:to="loc_us-gaap_CreditFacilityDomain_78bbb4d3-f321-44c2-8716-3063691447d8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_MinCashTestDate1Member_d37c468b-480e-4619-b010-c78f3e889314" xlink:href="xfor-20240331.xsd#xfor_MinCashTestDate1Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_78bbb4d3-f321-44c2-8716-3063691447d8" xlink:to="loc_xfor_MinCashTestDate1Member_d37c468b-480e-4619-b010-c78f3e889314" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_StatementScenarioAxis_6f207066-a9f8-46c3-8d18-5ca18b9c2b92" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_StatementScenarioAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:to="loc_srt_StatementScenarioAxis_6f207066-a9f8-46c3-8d18-5ca18b9c2b92" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_6f207066-a9f8-46c3-8d18-5ca18b9c2b92_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_StatementScenarioAxis_6f207066-a9f8-46c3-8d18-5ca18b9c2b92" xlink:to="loc_srt_ScenarioUnspecifiedDomain_6f207066-a9f8-46c3-8d18-5ca18b9c2b92_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioUnspecifiedDomain_0b64fe44-40a9-46ca-954d-e1cb8a4d93a0" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ScenarioUnspecifiedDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_StatementScenarioAxis_6f207066-a9f8-46c3-8d18-5ca18b9c2b92" xlink:to="loc_srt_ScenarioUnspecifiedDomain_0b64fe44-40a9-46ca-954d-e1cb8a4d93a0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_ScenarioForecastMember_b1a13596-0b8c-4dcf-96ed-4db2de5a4ac4" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_ScenarioForecastMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ScenarioUnspecifiedDomain_0b64fe44-40a9-46ca-954d-e1cb8a4d93a0" xlink:to="loc_srt_ScenarioForecastMember_b1a13596-0b8c-4dcf-96ed-4db2de5a4ac4" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VestingAxis_55ae160a-0c40-4d1c-a26a-2aa149ee5f9c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VestingAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_53ffe645-c82f-40c0-9325-ddb0085b1200" xlink:to="loc_us-gaap_VestingAxis_55ae160a-0c40-4d1c-a26a-2aa149ee5f9c" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VestingDomain_55ae160a-0c40-4d1c-a26a-2aa149ee5f9c_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VestingDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_VestingAxis_55ae160a-0c40-4d1c-a26a-2aa149ee5f9c" xlink:to="loc_us-gaap_VestingDomain_55ae160a-0c40-4d1c-a26a-2aa149ee5f9c_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VestingDomain_5656c67d-978d-4cd0-9298-34f2697dc654" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VestingDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_VestingAxis_55ae160a-0c40-4d1c-a26a-2aa149ee5f9c" xlink:to="loc_us-gaap_VestingDomain_5656c67d-978d-4cd0-9298-34f2697dc654" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationAwardTrancheOneMember_87d01d08-c674-4552-92cd-e39a3cabe324" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationAwardTrancheOneMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VestingDomain_5656c67d-978d-4cd0-9298-34f2697dc654" xlink:to="loc_us-gaap_ShareBasedCompensationAwardTrancheOneMember_87d01d08-c674-4552-92cd-e39a3cabe324" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationAwardTrancheTwoMember_e84f2eff-a6ff-4ce2-9468-8e4896d99db9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationAwardTrancheTwoMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VestingDomain_5656c67d-978d-4cd0-9298-34f2697dc654" xlink:to="loc_us-gaap_ShareBasedCompensationAwardTrancheTwoMember_e84f2eff-a6ff-4ce2-9468-8e4896d99db9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationAwardTrancheThreeMember_6ae68dfd-26d4-40e7-891c-432b26a501d4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationAwardTrancheThreeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VestingDomain_5656c67d-978d-4cd0-9298-34f2697dc654" xlink:to="loc_us-gaap_ShareBasedCompensationAwardTrancheThreeMember_6ae68dfd-26d4-40e7-891c-432b26a501d4" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromLinesOfCredit_c533e7c5-ed82-472d-9b1c-715e2215d73b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ProceedsFromLinesOfCredit"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_ProceedsFromLinesOfCredit_c533e7c5-ed82-472d-9b1c-715e2215d73b" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_643e6eb8-39fb-43ca-9860-cdfddcea1ed8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentBasisSpreadOnVariableRate1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_643e6eb8-39fb-43ca-9860-cdfddcea1ed8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentInterestRateIncreaseDecrease_bb87e086-4ffd-4ba8-9de9-c27d4f74f95c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentInterestRateIncreaseDecrease"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_DebtInstrumentInterestRateIncreaseDecrease_bb87e086-4ffd-4ba8-9de9-c27d4f74f95c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityPeriodicPayment_b095172d-600f-464d-b0de-4f6c27247af2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityPeriodicPayment"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_LineOfCreditFacilityPeriodicPayment_b095172d-600f-464d-b0de-4f6c27247af2" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LineOfCreditCovenantMinimumCash_fd5d1974-d543-49d4-b2b9-96a1c00e79e4" xlink:href="xfor-20240331.xsd#xfor_LineOfCreditCovenantMinimumCash"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_xfor_LineOfCreditCovenantMinimumCash_fd5d1974-d543-49d4-b2b9-96a1c00e79e4" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentInterestRateEffectivePercentage_903eb520-8e42-4c5d-ad2e-99cb5101906b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentInterestRateEffectivePercentage"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_DebtInstrumentInterestRateEffectivePercentage_903eb520-8e42-4c5d-ad2e-99cb5101906b" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentPeriodicPaymentPrincipal_3f4e1f9a-11b2-4407-92bf-a251797ca7ae" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentPeriodicPaymentPrincipal"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_DebtInstrumentPeriodicPaymentPrincipal_3f4e1f9a-11b2-4407-92bf-a251797ca7ae" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_a2e2069a-1451-47cf-82d4-b7abe6ace118" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_41cc1e11-03f6-41cc-aafa-77f1adfe0d8a" xlink:to="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_a2e2069a-1451-47cf-82d4-b7abe6ace118" xlink:type="arc" order="7"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LongTermDebtSummaryofInterestExpenseDetails" xlink:type="simple" xlink:href="xfor-20240331.xsd#LongTermDebtSummaryofInterestExpenseDetails"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/LongTermDebtSummaryofInterestExpenseDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentLineItems_7c1df59d-a63c-4982-b3c1-c9e109eaf42d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentTable_b2028559-84e9-40d3-9d1d-9b864933e6b2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_7c1df59d-a63c-4982-b3c1-c9e109eaf42d" xlink:to="loc_us-gaap_DebtInstrumentTable_b2028559-84e9-40d3-9d1d-9b864933e6b2" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentAxis_21385aa8-7247-45a2-81d3-a0211ba0651f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_b2028559-84e9-40d3-9d1d-9b864933e6b2" xlink:to="loc_us-gaap_DebtInstrumentAxis_21385aa8-7247-45a2-81d3-a0211ba0651f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_21385aa8-7247-45a2-81d3-a0211ba0651f_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_21385aa8-7247-45a2-81d3-a0211ba0651f" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_21385aa8-7247-45a2-81d3-a0211ba0651f_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_5c6a4292-f486-4c34-b01f-619ba1acf08c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_21385aa8-7247-45a2-81d3-a0211ba0651f" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_5c6a4292-f486-4c34-b01f-619ba1acf08c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_HerculesLoanAgreementMember_fc034311-f10b-4152-a3df-7f597e08015a" xlink:href="xfor-20240331.xsd#xfor_HerculesLoanAgreementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_5c6a4292-f486-4c34-b01f-619ba1acf08c" xlink:to="loc_xfor_HerculesLoanAgreementMember_fc034311-f10b-4152-a3df-7f597e08015a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_741e69a2-f512-4d9d-824f-635bdeb907d6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_b2028559-84e9-40d3-9d1d-9b864933e6b2" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_741e69a2-f512-4d9d-824f-635bdeb907d6" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_741e69a2-f512-4d9d-824f-635bdeb907d6_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_741e69a2-f512-4d9d-824f-635bdeb907d6" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_741e69a2-f512-4d9d-824f-635bdeb907d6_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_03555674-6c00-42c6-a384-6519ec780383" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LongtermDebtTypeDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_741e69a2-f512-4d9d-824f-635bdeb907d6" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_03555674-6c00-42c6-a384-6519ec780383" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VariableRateAxis_482f4dc1-db60-465b-aca8-63a4f59fa9a1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VariableRateAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_b2028559-84e9-40d3-9d1d-9b864933e6b2" xlink:to="loc_us-gaap_VariableRateAxis_482f4dc1-db60-465b-aca8-63a4f59fa9a1" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VariableRateDomain_482f4dc1-db60-465b-aca8-63a4f59fa9a1_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VariableRateDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_VariableRateAxis_482f4dc1-db60-465b-aca8-63a4f59fa9a1" xlink:to="loc_us-gaap_VariableRateDomain_482f4dc1-db60-465b-aca8-63a4f59fa9a1_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_VariableRateDomain_2455ffe7-f3fd-4fe8-81e9-fe4e72b60b18" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_VariableRateDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_VariableRateAxis_482f4dc1-db60-465b-aca8-63a4f59fa9a1" xlink:to="loc_us-gaap_VariableRateDomain_2455ffe7-f3fd-4fe8-81e9-fe4e72b60b18" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentRedemptionPeriodAxis_3e3fe38c-af23-47c2-abf1-7604a4d5dd18" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentRedemptionPeriodAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_b2028559-84e9-40d3-9d1d-9b864933e6b2" xlink:to="loc_us-gaap_DebtInstrumentRedemptionPeriodAxis_3e3fe38c-af23-47c2-abf1-7604a4d5dd18" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentRedemptionPeriodDomain_3e3fe38c-af23-47c2-abf1-7604a4d5dd18_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentRedemptionPeriodDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentRedemptionPeriodAxis_3e3fe38c-af23-47c2-abf1-7604a4d5dd18" xlink:to="loc_us-gaap_DebtInstrumentRedemptionPeriodDomain_3e3fe38c-af23-47c2-abf1-7604a4d5dd18_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtInstrumentRedemptionPeriodDomain_c4e377d6-b2e9-4823-a429-98831172cd03" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DebtInstrumentRedemptionPeriodDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentRedemptionPeriodAxis_3e3fe38c-af23-47c2-abf1-7604a4d5dd18" xlink:to="loc_us-gaap_DebtInstrumentRedemptionPeriodDomain_c4e377d6-b2e9-4823-a429-98831172cd03" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_e171c731-b54f-4099-81df-fd7ac0438278" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_b2028559-84e9-40d3-9d1d-9b864933e6b2" xlink:to="loc_srt_RangeAxis_e171c731-b54f-4099-81df-fd7ac0438278" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_e171c731-b54f-4099-81df-fd7ac0438278_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_e171c731-b54f-4099-81df-fd7ac0438278" xlink:to="loc_srt_RangeMember_e171c731-b54f-4099-81df-fd7ac0438278_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_a2de3a14-51f8-446f-a3aa-ca06c223f015" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_e171c731-b54f-4099-81df-fd7ac0438278" xlink:to="loc_srt_RangeMember_a2de3a14-51f8-446f-a3aa-ca06c223f015" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseDebt_5fa92876-65ca-4091-8d42-c81146334d5a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_InterestExpenseDebt"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_7c1df59d-a63c-4982-b3c1-c9e109eaf42d" xlink:to="loc_us-gaap_InterestExpenseDebt_5fa92876-65ca-4091-8d42-c81146334d5a" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfDebtDiscountPremium_b719f8c5-62f3-42f1-8f7f-11f8f4a2eaea" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AmortizationOfDebtDiscountPremium"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_7c1df59d-a63c-4982-b3c1-c9e109eaf42d" xlink:to="loc_us-gaap_AmortizationOfDebtDiscountPremium_b719f8c5-62f3-42f1-8f7f-11f8f4a2eaea" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/LeasesAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#LeasesAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/LeasesAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LesseeLeaseDescriptionLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable_56a2bd2f-9913-41c5-af69-8644fc98ea56" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LesseeLeaseDescriptionTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:to="loc_us-gaap_LesseeLeaseDescriptionTable_56a2bd2f-9913-41c5-af69-8644fc98ea56" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_f821b6cd-ba6d-4fe2-9072-557f3070e0c9" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable_56a2bd2f-9913-41c5-af69-8644fc98ea56" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_f821b6cd-ba6d-4fe2-9072-557f3070e0c9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_f821b6cd-ba6d-4fe2-9072-557f3070e0c9_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_f821b6cd-ba6d-4fe2-9072-557f3070e0c9" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_f821b6cd-ba6d-4fe2-9072-557f3070e0c9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_68e4e00c-84dc-478c-bee8-ef611400b8b9" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_f821b6cd-ba6d-4fe2-9072-557f3070e0c9" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_68e4e00c-84dc-478c-bee8-ef611400b8b9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_WalthamLeaseMember_bdbc114d-b4a9-417d-a19d-a481d7be74c6" xlink:href="xfor-20240331.xsd#xfor_WalthamLeaseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_68e4e00c-84dc-478c-bee8-ef611400b8b9" xlink:to="loc_xfor_WalthamLeaseMember_bdbc114d-b4a9-417d-a19d-a481d7be74c6" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ViennaAustriaLeaseMember_f37af296-1dcc-40ec-b5da-45c9a9b1c3a8" xlink:href="xfor-20240331.xsd#xfor_ViennaAustriaLeaseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_68e4e00c-84dc-478c-bee8-ef611400b8b9" xlink:to="loc_xfor_ViennaAustriaLeaseMember_f37af296-1dcc-40ec-b5da-45c9a9b1c3a8" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_AllstonLeaseMember_be0ff511-fbb3-4e48-a416-498c07d51d30" xlink:href="xfor-20240331.xsd#xfor_AllstonLeaseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_68e4e00c-84dc-478c-bee8-ef611400b8b9" xlink:to="loc_xfor_AllstonLeaseMember_be0ff511-fbb3-4e48-a416-498c07d51d30" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LesseeOperatingLeaseLeaseNotYetCommencedOfficeSpace_2223e4e5-0e7e-43aa-91b2-0fe3e2b6c82c" xlink:href="xfor-20240331.xsd#xfor_LesseeOperatingLeaseLeaseNotYetCommencedOfficeSpace"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:to="loc_xfor_LesseeOperatingLeaseLeaseNotYetCommencedOfficeSpace_2223e4e5-0e7e-43aa-91b2-0fe3e2b6c82c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLeaseNotYetCommencedTermOfContract1_758cd921-f1f3-4867-b208-40addd9d264a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LesseeOperatingLeaseLeaseNotYetCommencedTermOfContract1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:to="loc_us-gaap_LesseeOperatingLeaseLeaseNotYetCommencedTermOfContract1_758cd921-f1f3-4867-b208-40addd9d264a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LesseeOperatingLeaseLeaseNotYetCommencedAnnualBaseRent_2c2c6f18-6c01-4f45-abb1-3475d795a644" xlink:href="xfor-20240331.xsd#xfor_LesseeOperatingLeaseLeaseNotYetCommencedAnnualBaseRent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:to="loc_xfor_LesseeOperatingLeaseLeaseNotYetCommencedAnnualBaseRent_2c2c6f18-6c01-4f45-abb1-3475d795a644" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LesseeOperatingLeaseLeaseNotYetCommencedAmount_6770c287-4f6e-412a-8b08-9d503a65c939" xlink:href="xfor-20240331.xsd#xfor_LesseeOperatingLeaseLeaseNotYetCommencedAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:to="loc_xfor_LesseeOperatingLeaseLeaseNotYetCommencedAmount_6770c287-4f6e-412a-8b08-9d503a65c939" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiability_ac32e9a5-7dd4-48e1-80db-e7c4efbfe5cd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingLeaseLiability"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:to="loc_us-gaap_OperatingLeaseLiability_ac32e9a5-7dd4-48e1-80db-e7c4efbfe5cd" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_cf4c1a76-745a-429e-9fe0-07b02c3e22a1" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_OperatingLeaseRightOfUseAsset"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_86ca1566-c703-4c22-960c-93c15b893343" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_cf4c1a76-745a-429e-9fe0-07b02c3e22a1" xlink:type="arc" order="5"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/CommitmentandContingenciesAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#CommitmentandContingenciesAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/CommitmentandContingenciesAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ContingenciesAndCommitmentsLineItems_703def84-0a77-4589-b4f9-07c44e4aeb31" xlink:href="xfor-20240331.xsd#xfor_ContingenciesAndCommitmentsLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ContingenciesAndCommitmentsTable_74335f9b-0619-446e-8fc9-51afa6881628" xlink:href="xfor-20240331.xsd#xfor_ContingenciesAndCommitmentsTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_xfor_ContingenciesAndCommitmentsLineItems_703def84-0a77-4589-b4f9-07c44e4aeb31" xlink:to="loc_xfor_ContingenciesAndCommitmentsTable_74335f9b-0619-446e-8fc9-51afa6881628" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TypeOfArrangementAxis_9006955f-a7cf-43bc-825b-2871dd5809c9" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_TypeOfArrangementAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_xfor_ContingenciesAndCommitmentsTable_74335f9b-0619-446e-8fc9-51afa6881628" xlink:to="loc_us-gaap_TypeOfArrangementAxis_9006955f-a7cf-43bc-825b-2871dd5809c9" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_9006955f-a7cf-43bc-825b-2871dd5809c9_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ArrangementsAndNonarrangementTransactionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_TypeOfArrangementAxis_9006955f-a7cf-43bc-825b-2871dd5809c9" xlink:to="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_9006955f-a7cf-43bc-825b-2871dd5809c9_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_4c6d8f5a-c674-4867-8a01-3cd0ef37158a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ArrangementsAndNonarrangementTransactionsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_TypeOfArrangementAxis_9006955f-a7cf-43bc-825b-2871dd5809c9" xlink:to="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_4c6d8f5a-c674-4867-8a01-3cd0ef37158a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IndemnificationAgreementsMember_8614cff4-b9ad-44ed-a31a-59ab451f4cb3" xlink:href="xfor-20240331.xsd#xfor_IndemnificationAgreementsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ArrangementsAndNonarrangementTransactionsMember_4c6d8f5a-c674-4867-8a01-3cd0ef37158a" xlink:to="loc_xfor_IndemnificationAgreementsMember_8614cff4-b9ad-44ed-a31a-59ab451f4cb3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LossContingencyAccrualAtCarryingValue_faee88c5-f0b0-46de-85b1-b60d6630ad80" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_LossContingencyAccrualAtCarryingValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_ContingenciesAndCommitmentsLineItems_703def84-0a77-4589-b4f9-07c44e4aeb31" xlink:to="loc_us-gaap_LossContingencyAccrualAtCarryingValue_faee88c5-f0b0-46de-85b1-b60d6630ad80" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedLiabilitiesCurrentAndNoncurrent_614262a8-a8b8-4e46-a1d4-66e5a0c76299" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AccruedLiabilitiesCurrentAndNoncurrent"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_ContingenciesAndCommitmentsLineItems_703def84-0a77-4589-b4f9-07c44e4aeb31" xlink:to="loc_us-gaap_AccruedLiabilitiesCurrentAndNoncurrent_614262a8-a8b8-4e46-a1d4-66e5a0c76299" xlink:type="arc" order="1"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/CommonStockWarrantsAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#CommonStockWarrantsAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/CommonStockWarrantsAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightLineItems_a2f19236-6938-4216-b09e-e8c2a8a7424c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightTable_c77451cb-b2ad-4c51-b529-61424091c58f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_a2f19236-6938-4216-b09e-e8c2a8a7424c" xlink:to="loc_us-gaap_ClassOfWarrantOrRightTable_c77451cb-b2ad-4c51-b529-61424091c58f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_2c1db053-c15e-4436-966f-172d5cbc3e97" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfWarrantOrRightTable_c77451cb-b2ad-4c51-b529-61424091c58f" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_2c1db053-c15e-4436-966f-172d5cbc3e97" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_2c1db053-c15e-4436-966f-172d5cbc3e97_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_2c1db053-c15e-4436-966f-172d5cbc3e97" xlink:to="loc_us-gaap_EquityComponentDomain_2c1db053-c15e-4436-966f-172d5cbc3e97_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_262b4118-3746-4ed7-a88c-aeee41a2256e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_2c1db053-c15e-4436-966f-172d5cbc3e97" xlink:to="loc_us-gaap_EquityComponentDomain_262b4118-3746-4ed7-a88c-aeee41a2256e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_Q12022PrivatePlacementMember_caced750-e28b-49b3-9525-f0da691381cd" xlink:href="xfor-20240331.xsd#xfor_Q12022PrivatePlacementMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_262b4118-3746-4ed7-a88c-aeee41a2256e" xlink:to="loc_xfor_Q12022PrivatePlacementMember_caced750-e28b-49b3-9525-f0da691381cd" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockSharesAuthorized_bd8d0759-8ac7-455b-bcca-a457fc0cfe13" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockSharesAuthorized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_a2f19236-6938-4216-b09e-e8c2a8a7424c" xlink:to="loc_us-gaap_CommonStockSharesAuthorized_bd8d0759-8ac7-455b-bcca-a457fc0cfe13" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockParOrStatedValuePerShare_472d0743-51e4-4694-95ec-cd8789aef28a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockParOrStatedValuePerShare"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_a2f19236-6938-4216-b09e-e8c2a8a7424c" xlink:to="loc_us-gaap_CommonStockParOrStatedValuePerShare_472d0743-51e4-4694-95ec-cd8789aef28a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DividendsCommonStock_81f14daf-5ad3-42ae-8609-e379e6aa9608" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_DividendsCommonStock"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_a2f19236-6938-4216-b09e-e8c2a8a7424c" xlink:to="loc_us-gaap_DividendsCommonStock_81f14daf-5ad3-42ae-8609-e379e6aa9608" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights_e0aaf046-d3dc-4716-8ade-47ff871856ca" xlink:href="xfor-20240331.xsd#xfor_ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_a2f19236-6938-4216-b09e-e8c2a8a7424c" xlink:to="loc_xfor_ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights_e0aaf046-d3dc-4716-8ade-47ff871856ca" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/CommonStockWarrantsSummaryofOutstandingWarrantstoPurchaseSharesofCommonStockDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#CommonStockWarrantsSummaryofOutstandingWarrantstoPurchaseSharesofCommonStockDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/CommonStockWarrantsSummaryofOutstandingWarrantstoPurchaseSharesofCommonStockDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightLineItems_4034979e-db38-426d-9a66-483c82b9cfd7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightTable_c46d7823-2ab3-48dd-a455-9902666af0ed" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_4034979e-db38-426d-9a66-483c82b9cfd7" xlink:to="loc_us-gaap_ClassOfWarrantOrRightTable_c46d7823-2ab3-48dd-a455-9902666af0ed" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightAxis_51c53c6e-82f2-46d9-8f77-a81c91873d91" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfWarrantOrRightTable_c46d7823-2ab3-48dd-a455-9902666af0ed" xlink:to="loc_us-gaap_ClassOfWarrantOrRightAxis_51c53c6e-82f2-46d9-8f77-a81c91873d91" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightDomain_51c53c6e-82f2-46d9-8f77-a81c91873d91_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ClassOfWarrantOrRightAxis_51c53c6e-82f2-46d9-8f77-a81c91873d91" xlink:to="loc_us-gaap_ClassOfWarrantOrRightDomain_51c53c6e-82f2-46d9-8f77-a81c91873d91_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ClassOfWarrantOrRightAxis_51c53c6e-82f2-46d9-8f77-a81c91873d91" xlink:to="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnOctoberTwentyFiveTwoThousandSixteenMember_c2f39a06-901a-4075-a310-128f7004712c" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnOctoberTwentyFiveTwoThousandSixteenMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnOctoberTwentyFiveTwoThousandSixteenMember_c2f39a06-901a-4075-a310-128f7004712c" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnDecemberTwentyEightTwoThousandSeventeenOneMember_0042274a-f62f-4c81-8b8e-78d37bed9d4f" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnDecemberTwentyEightTwoThousandSeventeenOneMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnDecemberTwentyEightTwoThousandSeventeenOneMember_0042274a-f62f-4c81-8b8e-78d37bed9d4f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnSeptemberTwelveTwoThousandEighteenOneMember_98746ce0-3caa-4af7-9c2d-953b93044527" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnSeptemberTwelveTwoThousandEighteenOneMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnSeptemberTwelveTwoThousandEighteenOneMember_98746ce0-3caa-4af7-9c2d-953b93044527" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnOctoberNineteenTwoThousandEighteenMember_b9a23bbb-c458-405c-88b9-7aa865cf9093" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnOctoberNineteenTwoThousandEighteenMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnOctoberNineteenTwoThousandEighteenMember_b9a23bbb-c458-405c-88b9-7aa865cf9093" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnMarchThirteenTwoThousandNineteenMember_b70021a8-a4e2-46b1-9983-b25a7dd6a400" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnMarchThirteenTwoThousandNineteenMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnMarchThirteenTwoThousandNineteenMember_b70021a8-a4e2-46b1-9983-b25a7dd6a400" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnAprilSixteenTwoThousandNineteenMember_5a122ac6-161b-433a-b577-516692546c49" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnAprilSixteenTwoThousandNineteenMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnAprilSixteenTwoThousandNineteenMember_5a122ac6-161b-433a-b577-516692546c49" xlink:type="arc" order="5"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnNovemberTwentyNineTwoThousandNineteenOneMember_e36c3670-a5d6-47bf-ad67-abbc2736fa8f" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnNovemberTwentyNineTwoThousandNineteenOneMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnNovemberTwentyNineTwoThousandNineteenOneMember_e36c3670-a5d6-47bf-ad67-abbc2736fa8f" xlink:type="arc" order="6"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnMarch232021Member_84d158ea-13d6-4bf2-9547-825b34391044" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnMarch232021Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnMarch232021Member_84d158ea-13d6-4bf2-9547-825b34391044" xlink:type="arc" order="7"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_PreFundedWarrantMember_6b4e7d4a-cd87-412d-8edb-cffd4c4114b0" xlink:href="xfor-20240331.xsd#xfor_PreFundedWarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_PreFundedWarrantMember_6b4e7d4a-cd87-412d-8edb-cffd4c4114b0" xlink:type="arc" order="8"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnNovemberNineTwoThousandTwentyOneMember_83439d32-f01f-47fb-a27a-c40f635ed727" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnNovemberNineTwoThousandTwentyOneMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnNovemberNineTwoThousandTwentyOneMember_83439d32-f01f-47fb-a27a-c40f635ed727" xlink:type="arc" order="9"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnMarch32022Member_186e12bd-0f8f-4357-b36d-175c6877c24f" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnMarch32022Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnMarch32022Member_186e12bd-0f8f-4357-b36d-175c6877c24f" xlink:type="arc" order="10"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnJuly20221Member_2a8b980b-3010-494d-8f38-33b73afc3512" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnJuly20221Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnJuly20221Member_2a8b980b-3010-494d-8f38-33b73afc3512" xlink:type="arc" order="11"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnJuly620222Member_68db7526-a667-44bd-95f6-e6434a7b3cdb" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnJuly620222Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnJuly620222Member_68db7526-a667-44bd-95f6-e6434a7b3cdb" xlink:type="arc" order="12"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnDecember92022Member_cee54056-3146-4700-b214-6d9bd156e665" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnDecember92022Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnDecember92022Member_cee54056-3146-4700-b214-6d9bd156e665" xlink:type="arc" order="13"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnDecember920222Member_3a0c0803-844d-4a3c-a16f-b0adcbd1693d" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnDecember920222Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnDecember920222Member_3a0c0803-844d-4a3c-a16f-b0adcbd1693d" xlink:type="arc" order="14"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_IssuanceOnMay192023Member_7c394a1b-0ce5-42d6-99fd-0af8867d49e8" xlink:href="xfor-20240331.xsd#xfor_IssuanceOnMay192023Member"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightDomain_3678fa22-c762-4934-9856-205a02e86952" xlink:to="loc_xfor_IssuanceOnMay192023Member_7c394a1b-0ce5-42d6-99fd-0af8867d49e8" xlink:type="arc" order="15"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_9b00601c-b971-4876-88d0-9ea281b2f7d0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfWarrantOrRightTable_c46d7823-2ab3-48dd-a455-9902666af0ed" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_9b00601c-b971-4876-88d0-9ea281b2f7d0" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_9b00601c-b971-4876-88d0-9ea281b2f7d0_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_9b00601c-b971-4876-88d0-9ea281b2f7d0" xlink:to="loc_us-gaap_EquityComponentDomain_9b00601c-b971-4876-88d0-9ea281b2f7d0_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_5a567a9e-07f8-4a49-859d-1afb2e4023c6" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_9b00601c-b971-4876-88d0-9ea281b2f7d0" xlink:to="loc_us-gaap_EquityComponentDomain_5a567a9e-07f8-4a49-859d-1afb2e4023c6" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_PreFundedWarrantMember_d878004a-3f42-492c-b1e3-36ef0f485deb" xlink:href="xfor-20240331.xsd#xfor_PreFundedWarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_5a567a9e-07f8-4a49-859d-1afb2e4023c6" xlink:to="loc_xfor_PreFundedWarrantMember_d878004a-3f42-492c-b1e3-36ef0f485deb" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ClassAWarrantMember_42b2ce3e-729f-48a8-9f1d-8034ed68dcc0" xlink:href="xfor-20240331.xsd#xfor_ClassAWarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_5a567a9e-07f8-4a49-859d-1afb2e4023c6" xlink:to="loc_xfor_ClassAWarrantMember_42b2ce3e-729f-48a8-9f1d-8034ed68dcc0" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_LegacyWarrantsMember_b727efd5-d465-47ae-a0aa-944597e0a62c" xlink:href="xfor-20240331.xsd#xfor_LegacyWarrantsMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_5a567a9e-07f8-4a49-859d-1afb2e4023c6" xlink:to="loc_xfor_LegacyWarrantsMember_b727efd5-d465-47ae-a0aa-944597e0a62c" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_PrefundedWarrantsAxis_4f98c294-e012-4a64-8e16-4a079f968af8" xlink:href="xfor-20240331.xsd#xfor_PrefundedWarrantsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ClassOfWarrantOrRightTable_c46d7823-2ab3-48dd-a455-9902666af0ed" xlink:to="loc_xfor_PrefundedWarrantsAxis_4f98c294-e012-4a64-8e16-4a079f968af8" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_PrefundedWarrantsDomain_4f98c294-e012-4a64-8e16-4a079f968af8_default" xlink:href="xfor-20240331.xsd#xfor_PrefundedWarrantsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_xfor_PrefundedWarrantsAxis_4f98c294-e012-4a64-8e16-4a079f968af8" xlink:to="loc_xfor_PrefundedWarrantsDomain_4f98c294-e012-4a64-8e16-4a079f968af8_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_PrefundedWarrantsDomain_b220e796-3a53-4586-88b6-79ee5ccab8fe" xlink:href="xfor-20240331.xsd#xfor_PrefundedWarrantsDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_xfor_PrefundedWarrantsAxis_4f98c294-e012-4a64-8e16-4a079f968af8" xlink:to="loc_xfor_PrefundedWarrantsDomain_b220e796-3a53-4586-88b6-79ee5ccab8fe" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_FundedMember_bf039282-aef4-4de8-9a48-62e89d6f8603" xlink:href="xfor-20240331.xsd#xfor_FundedMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_xfor_PrefundedWarrantsDomain_b220e796-3a53-4586-88b6-79ee5ccab8fe" xlink:to="loc_xfor_FundedMember_bf039282-aef4-4de8-9a48-62e89d6f8603" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightOutstanding_c9f69daf-7744-40cc-9c1e-385d6f31651f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightOutstanding"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_4034979e-db38-426d-9a66-483c82b9cfd7" xlink:to="loc_us-gaap_ClassOfWarrantOrRightOutstanding_c9f69daf-7744-40cc-9c1e-385d6f31651f" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightExercisePriceOfWarrantsOrRights1_16b2044d-62a0-4230-9d96-51016aaf619c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightExercisePriceOfWarrantsOrRights1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_4034979e-db38-426d-9a66-483c82b9cfd7" xlink:to="loc_us-gaap_ClassOfWarrantOrRightExercisePriceOfWarrantsOrRights1_16b2044d-62a0-4230-9d96-51016aaf619c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ClassOfWarrantOrRightAggregateProceedsFromWarrantsIssued_f86accbc-ae4e-4864-bd13-308fe02004d9" xlink:href="xfor-20240331.xsd#xfor_ClassOfWarrantOrRightAggregateProceedsFromWarrantsIssued"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_4034979e-db38-426d-9a66-483c82b9cfd7" xlink:to="loc_xfor_ClassOfWarrantOrRightAggregateProceedsFromWarrantsIssued_f86accbc-ae4e-4864-bd13-308fe02004d9" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights_d8bd734b-e8b0-4478-9a98-57a2d3dad660" xlink:href="xfor-20240331.xsd#xfor_ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfWarrantOrRightLineItems_4034979e-db38-426d-9a66-483c82b9cfd7" xlink:to="loc_xfor_ClassOfWarrantOrRightAdditionalExercisePriceOfWarrantsOrRights_d8bd734b-e8b0-4478-9a98-57a2d3dad660" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/StockBasedCompensationAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#StockBasedCompensationAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/StockBasedCompensationAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_36817528-bd49-473e-bf00-3497353d2f75" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7f77eb6b-d8fa-4f43-9b7b-3c5e960a178f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_36817528-bd49-473e-bf00-3497353d2f75" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7f77eb6b-d8fa-4f43-9b7b-3c5e960a178f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameAxis_3966fbf3-e348-4e70-ad5c-d332d5546221" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PlanNameAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7f77eb6b-d8fa-4f43-9b7b-3c5e960a178f" xlink:to="loc_us-gaap_PlanNameAxis_3966fbf3-e348-4e70-ad5c-d332d5546221" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameDomain_3966fbf3-e348-4e70-ad5c-d332d5546221_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PlanNameAxis_3966fbf3-e348-4e70-ad5c-d332d5546221" xlink:to="loc_us-gaap_PlanNameDomain_3966fbf3-e348-4e70-ad5c-d332d5546221_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PlanNameDomain_5dee38fa-b63d-45bd-9b90-4b73bbc2dee2" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_PlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PlanNameAxis_3966fbf3-e348-4e70-ad5c-d332d5546221" xlink:to="loc_us-gaap_PlanNameDomain_5dee38fa-b63d-45bd-9b90-4b73bbc2dee2" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_TwoThousandNineteenEquityIncentivePlanMember_8c63a9ed-4b45-4e1a-877c-cf8bcfc8a5b3" xlink:href="xfor-20240331.xsd#xfor_TwoThousandNineteenEquityIncentivePlanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_5dee38fa-b63d-45bd-9b90-4b73bbc2dee2" xlink:to="loc_xfor_TwoThousandNineteenEquityIncentivePlanMember_8c63a9ed-4b45-4e1a-877c-cf8bcfc8a5b3" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_TwoThousandSeventeenEquityIncentivePlanMember_5edf66fb-9e6f-4c9a-9acd-4e381da7edc7" xlink:href="xfor-20240331.xsd#xfor_TwoThousandSeventeenEquityIncentivePlanMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_5dee38fa-b63d-45bd-9b90-4b73bbc2dee2" xlink:to="loc_xfor_TwoThousandSeventeenEquityIncentivePlanMember_5edf66fb-9e6f-4c9a-9acd-4e381da7edc7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_52fa264c-9d15-4d86-b176-5517b14811bd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7f77eb6b-d8fa-4f43-9b7b-3c5e960a178f" xlink:to="loc_us-gaap_AwardTypeAxis_52fa264c-9d15-4d86-b176-5517b14811bd" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_52fa264c-9d15-4d86-b176-5517b14811bd_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_52fa264c-9d15-4d86-b176-5517b14811bd" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_52fa264c-9d15-4d86-b176-5517b14811bd_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_0eaa8ae5-dbfe-49b5-9e89-1d2d6c741880" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_52fa264c-9d15-4d86-b176-5517b14811bd" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_0eaa8ae5-dbfe-49b5-9e89-1d2d6c741880" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_baf2f807-6816-4060-8d6f-5e5eae62cc87" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_0eaa8ae5-dbfe-49b5-9e89-1d2d6c741880" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_baf2f807-6816-4060-8d6f-5e5eae62cc87" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockCapitalSharesReservedForFutureIssuance_c58bbc32-a828-492c-b21e-20ba0dc46800" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_CommonStockCapitalSharesReservedForFutureIssuance"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_36817528-bd49-473e-bf00-3497353d2f75" xlink:to="loc_us-gaap_CommonStockCapitalSharesReservedForFutureIssuance_c58bbc32-a828-492c-b21e-20ba0dc46800" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardsGrantInPeriodWeightedAverageGrantDateFairValue_bc888b14-2a39-4790-bcde-6b06f2e02f2f" xlink:href="xfor-20240331.xsd#xfor_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardsGrantInPeriodWeightedAverageGrantDateFairValue"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_36817528-bd49-473e-bf00-3497353d2f75" xlink:to="loc_xfor_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardsGrantInPeriodWeightedAverageGrantDateFairValue_bc888b14-2a39-4790-bcde-6b06f2e02f2f" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_ccadd054-f7d0-4907-bb46-670fe00f9a48" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_36817528-bd49-473e-bf00-3497353d2f75" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognized_ccadd054-f7d0-4907-bb46-670fe00f9a48" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_3949f64c-ab85-4221-b5b8-5a6b9c9c9c25" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_36817528-bd49-473e-bf00-3497353d2f75" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_3949f64c-ab85-4221-b5b8-5a6b9c9c9c25" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/StockBasedCompensationScheduleofAssumptionsUsedinBlackScholesOptionPricingModeltoDetermineGrantdateFairValueofStockOptionsGrantedDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#StockBasedCompensationScheduleofAssumptionsUsedinBlackScholesOptionPricingModeltoDetermineGrantdateFairValueofStockOptionsGrantedDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/StockBasedCompensationScheduleofAssumptionsUsedinBlackScholesOptionPricingModeltoDetermineGrantdateFairValueofStockOptionsGrantedDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_ba7934c7-c633-46ca-9cfe-09da9c820e6c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_88d26ab8-70e0-4a42-99f7-ea7c9cbaa566" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_ba7934c7-c633-46ca-9cfe-09da9c820e6c" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_88d26ab8-70e0-4a42-99f7-ea7c9cbaa566" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_6e12c63d-c494-420a-ba5d-ebf060cf689e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_88d26ab8-70e0-4a42-99f7-ea7c9cbaa566" xlink:to="loc_us-gaap_AwardTypeAxis_6e12c63d-c494-420a-ba5d-ebf060cf689e" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_6e12c63d-c494-420a-ba5d-ebf060cf689e_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_6e12c63d-c494-420a-ba5d-ebf060cf689e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_6e12c63d-c494-420a-ba5d-ebf060cf689e_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_e1c1ad1d-67cb-4306-9249-ea2137cae27c" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_6e12c63d-c494-420a-ba5d-ebf060cf689e" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_e1c1ad1d-67cb-4306-9249-ea2137cae27c" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantMember_df3be275-28d8-4c91-a953-718811fce213" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_e1c1ad1d-67cb-4306-9249-ea2137cae27c" xlink:to="loc_us-gaap_WarrantMember_df3be275-28d8-4c91-a953-718811fce213" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_644b84ae-2509-43bb-a317-87e78fdbe975" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_ba7934c7-c633-46ca-9cfe-09da9c820e6c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRate_644b84ae-2509-43bb-a317-87e78fdbe975" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_34ab65ca-2a48-458b-89f6-c1d875ec3cf3" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_ba7934c7-c633-46ca-9cfe-09da9c820e6c" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_34ab65ca-2a48-458b-89f6-c1d875ec3cf3" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_56127ed9-61b0-4d5e-8019-a18546ad89fc" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_ba7934c7-c633-46ca-9cfe-09da9c820e6c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRate_56127ed9-61b0-4d5e-8019-a18546ad89fc" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_0493c8de-e79c-4330-846b-b79ea847f1c4" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_ba7934c7-c633-46ca-9cfe-09da9c820e6c" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_0493c8de-e79c-4330-846b-b79ea847f1c4" xlink:type="arc" order="3"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/StockBasedCompensationRestrictedStockUnitsDetails" xlink:type="simple" xlink:href="xfor-20240331.xsd#StockBasedCompensationRestrictedStockUnitsDetails"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/StockBasedCompensationRestrictedStockUnitsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_03cb02b9-057c-4d3d-9f29-24cf40678fa0" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_f0582425-ea12-41d2-b5f6-aebea0c05d39" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_03cb02b9-057c-4d3d-9f29-24cf40678fa0" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_f0582425-ea12-41d2-b5f6-aebea0c05d39" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AwardTypeAxis_2463be13-6058-4873-adb0-50687ac0fd31" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AwardTypeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_f0582425-ea12-41d2-b5f6-aebea0c05d39" xlink:to="loc_us-gaap_AwardTypeAxis_2463be13-6058-4873-adb0-50687ac0fd31" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_2463be13-6058-4873-adb0-50687ac0fd31_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_2463be13-6058-4873-adb0-50687ac0fd31" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_2463be13-6058-4873-adb0-50687ac0fd31_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_7e2f5b9a-69a9-4d0d-969b-dea11dbffaea" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_2463be13-6058-4873-adb0-50687ac0fd31" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_7e2f5b9a-69a9-4d0d-969b-dea11dbffaea" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_422a3352-3013-4629-91b2-c068c6854d5d" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_7e2f5b9a-69a9-4d0d-969b-dea11dbffaea" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_422a3352-3013-4629-91b2-c068c6854d5d" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_111a1f91-30ac-4ac3-8290-ad0d2247b481" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_03cb02b9-057c-4d3d-9f29-24cf40678fa0" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_111a1f91-30ac-4ac3-8290-ad0d2247b481" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_cfabb6b6-8194-4632-b507-d226745fbb9a" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_111a1f91-30ac-4ac3-8290-ad0d2247b481" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_cfabb6b6-8194-4632-b507-d226745fbb9a" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_83610840-00f1-43b3-ac93-50651ee08175" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_111a1f91-30ac-4ac3-8290-ad0d2247b481" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_83610840-00f1-43b3-ac93-50651ee08175" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_48220179-b7d2-4f92-8224-4130efca41b7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_111a1f91-30ac-4ac3-8290-ad0d2247b481" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_48220179-b7d2-4f92-8224-4130efca41b7" xlink:type="arc" order="3"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_24ad5a2f-dc4e-45ba-bb43-17281ee8784b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_111a1f91-30ac-4ac3-8290-ad0d2247b481" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_24ad5a2f-dc4e-45ba-bb43-17281ee8784b" xlink:type="arc" order="4"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_4e99c123-1503-4445-8a62-ec241514889b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/StockBasedCompensationSummaryofStockBasedCompensationExpenseClassificationDetails" xlink:type="simple" xlink:href="xfor-20240331.xsd#StockBasedCompensationSummaryofStockBasedCompensationExpenseClassificationDetails"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/StockBasedCompensationSummaryofStockBasedCompensationExpenseClassificationDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1889bf4c-2678-4763-b881-b78773e744fe" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_c8aeaa28-c0d4-47a2-9c38-8aaf2558a30f" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1889bf4c-2678-4763-b881-b78773e744fe" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_c8aeaa28-c0d4-47a2-9c38-8aaf2558a30f" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationAxis_a2cd0c86-d082-42ff-9b0d-7df513a47b07" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeStatementLocationAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_c8aeaa28-c0d4-47a2-9c38-8aaf2558a30f" xlink:to="loc_us-gaap_IncomeStatementLocationAxis_a2cd0c86-d082-42ff-9b0d-7df513a47b07" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_a2cd0c86-d082-42ff-9b0d-7df513a47b07_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_a2cd0c86-d082-42ff-9b0d-7df513a47b07" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_a2cd0c86-d082-42ff-9b0d-7df513a47b07_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeStatementLocationDomain_233031e1-0492-4668-a61d-eca442eb99fb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_IncomeStatementLocationDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeStatementLocationAxis_a2cd0c86-d082-42ff-9b0d-7df513a47b07" xlink:to="loc_us-gaap_IncomeStatementLocationDomain_233031e1-0492-4668-a61d-eca442eb99fb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ResearchAndDevelopmentExpenseMember_4dcf6514-5791-4f5d-9514-1dba8ba7b532" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ResearchAndDevelopmentExpenseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_233031e1-0492-4668-a61d-eca442eb99fb" xlink:to="loc_us-gaap_ResearchAndDevelopmentExpenseMember_4dcf6514-5791-4f5d-9514-1dba8ba7b532" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GeneralAndAdministrativeExpenseMember_cd5512c1-a18c-4022-a04a-99c692fc4ad5" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_GeneralAndAdministrativeExpenseMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeStatementLocationDomain_233031e1-0492-4668-a61d-eca442eb99fb" xlink:to="loc_us-gaap_GeneralAndAdministrativeExpenseMember_cd5512c1-a18c-4022-a04a-99c692fc4ad5" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AllocatedShareBasedCompensationExpense_d87f8cbd-c1a0-4a2d-990c-f12fe1e6600b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AllocatedShareBasedCompensationExpense"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_1889bf4c-2678-4763-b881-b78773e744fe" xlink:to="loc_us-gaap_AllocatedShareBasedCompensationExpense_d87f8cbd-c1a0-4a2d-990c-f12fe1e6600b" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/NetLossperShareAdditionalInformationDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#NetLossperShareAdditionalInformationDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/NetLossperShareAdditionalInformationDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EarningsPerShareBasicLineItems_2f93db2c-a5e0-42c1-b776-85c755de0f29" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EarningsPerShareBasicLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_2eafdfb6-ae19-4e0f-8f85-b07fbb084bdd" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_2f93db2c-a5e0-42c1-b776-85c755de0f29" xlink:to="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_2eafdfb6-ae19-4e0f-8f85-b07fbb084bdd" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_c050938d-36d5-4bdc-97d9-14c275e63be7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_StatementEquityComponentsAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_2eafdfb6-ae19-4e0f-8f85-b07fbb084bdd" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_c050938d-36d5-4bdc-97d9-14c275e63be7" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_c050938d-36d5-4bdc-97d9-14c275e63be7_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_c050938d-36d5-4bdc-97d9-14c275e63be7" xlink:to="loc_us-gaap_EquityComponentDomain_c050938d-36d5-4bdc-97d9-14c275e63be7_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EquityComponentDomain_5779b8ff-48bc-4f5e-b75c-c62ba175c2eb" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EquityComponentDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_c050938d-36d5-4bdc-97d9-14c275e63be7" xlink:to="loc_us-gaap_EquityComponentDomain_5779b8ff-48bc-4f5e-b75c-c62ba175c2eb" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_xfor_PreFundedWarrantMember_b57b3544-cc33-4f82-b51f-b6912ccec772" xlink:href="xfor-20240331.xsd#xfor_PreFundedWarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_5779b8ff-48bc-4f5e-b75c-c62ba175c2eb" xlink:to="loc_xfor_PreFundedWarrantMember_b57b3544-cc33-4f82-b51f-b6912ccec772" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeAxis_3e0fa339-cd53-4528-9d70-37a8f20517ac" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfEarningsPerShareBasicByCommonClassTable_2eafdfb6-ae19-4e0f-8f85-b07fbb084bdd" xlink:to="loc_srt_RangeAxis_3e0fa339-cd53-4528-9d70-37a8f20517ac" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_3e0fa339-cd53-4528-9d70-37a8f20517ac_default" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_3e0fa339-cd53-4528-9d70-37a8f20517ac" xlink:to="loc_srt_RangeMember_3e0fa339-cd53-4528-9d70-37a8f20517ac_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_RangeMember_24493a74-728d-46f3-914f-2c0285dfd40d" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_RangeMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_3e0fa339-cd53-4528-9d70-37a8f20517ac" xlink:to="loc_srt_RangeMember_24493a74-728d-46f3-914f-2c0285dfd40d" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_srt_MaximumMember_c1d11f1b-c261-425e-87ed-2d520e64e6b8" xlink:href="https://xbrl.fasb.org/srt/2023/elts/srt-2023.xsd#srt_MaximumMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_24493a74-728d-46f3-914f-2c0285dfd40d" xlink:to="loc_srt_MaximumMember_c1d11f1b-c261-425e-87ed-2d520e64e6b8" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ClassOfWarrantOrRightExercisePriceOfWarrantsOrRights1_e42460e9-65e6-4e8f-8275-89cd1447cca8" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ClassOfWarrantOrRightExercisePriceOfWarrantsOrRights1"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EarningsPerShareBasicLineItems_2f93db2c-a5e0-42c1-b776-85c755de0f29" xlink:to="loc_us-gaap_ClassOfWarrantOrRightExercisePriceOfWarrantsOrRights1_e42460e9-65e6-4e8f-8275-89cd1447cca8" xlink:type="arc" order="0"/>
  </link:definitionLink>
  <link:roleRef roleURI="http://www.x4pharma.com/role/NetLossperShareScheduleofAntidilutiveSecuritiesExcludedfromComputationofDilutedNetLossperShareAttributabletoCommonStockholdersDetail" xlink:type="simple" xlink:href="xfor-20240331.xsd#NetLossperShareScheduleofAntidilutiveSecuritiesExcludedfromComputationofDilutedNetLossperShareAttributabletoCommonStockholdersDetail"/>
  <link:definitionLink xlink:role="http://www.x4pharma.com/role/NetLossperShareScheduleofAntidilutiveSecuritiesExcludedfromComputationofDilutedNetLossperShareAttributabletoCommonStockholdersDetail" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_0ca0329e-970c-4537-937e-5e61082fce01" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_611b50f7-6eae-4fe2-9c75-7c881205f1b7" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_0ca0329e-970c-4537-937e-5e61082fce01" xlink:to="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_611b50f7-6eae-4fe2-9c75-7c881205f1b7" xlink:type="arc" order="1" xbrldt:closed="true" xbrldt:contextElement="segment"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_86bb8eec-d80f-432a-8078-1e95c9d3af56" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareTable_611b50f7-6eae-4fe2-9c75-7c881205f1b7" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_86bb8eec-d80f-432a-8078-1e95c9d3af56" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_86bb8eec-d80f-432a-8078-1e95c9d3af56_default" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_86bb8eec-d80f-432a-8078-1e95c9d3af56" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_86bb8eec-d80f-432a-8078-1e95c9d3af56_default" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesNameDomain_4ceff04c-a6bc-490b-9106-98ee772e5d2b" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AntidilutiveSecuritiesNameDomain"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareByAntidilutiveSecuritiesAxis_86bb8eec-d80f-432a-8078-1e95c9d3af56" xlink:to="loc_us-gaap_AntidilutiveSecuritiesNameDomain_4ceff04c-a6bc-490b-9106-98ee772e5d2b" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EmployeeStockOptionMember_0a00b4ee-f5ef-4274-aca5-c7e788ade22e" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_EmployeeStockOptionMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_4ceff04c-a6bc-490b-9106-98ee772e5d2b" xlink:to="loc_us-gaap_EmployeeStockOptionMember_0a00b4ee-f5ef-4274-aca5-c7e788ade22e" xlink:type="arc" order="0"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_55838337-df9f-4ac6-9390-329547a36d67" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_RestrictedStockUnitsRSUMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_4ceff04c-a6bc-490b-9106-98ee772e5d2b" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_55838337-df9f-4ac6-9390-329547a36d67" xlink:type="arc" order="1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantMember_0a35f4c4-0dde-4472-a029-c6cfd63298de" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_WarrantMember"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesNameDomain_4ceff04c-a6bc-490b-9106-98ee772e5d2b" xlink:to="loc_us-gaap_WarrantMember_0a35f4c4-0dde-4472-a029-c6cfd63298de" xlink:type="arc" order="2"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_4267b19c-193a-4f54-bf22-32148d777d49" xlink:href="https://xbrl.fasb.org/us-gaap/2023/elts/us-gaap-2023.xsd#us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount"/>
    <link:definitionArc xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareLineItems_0ca0329e-970c-4537-937e-5e61082fce01" xlink:to="loc_us-gaap_AntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareAmount_4267b19c-193a-4f54-bf22-32148d777d49" xlink:type="arc" order="0"/>
  </link:definitionLink>
</link:linkbase>
