async def test_parse_facts_xml_with_malformed_xml():
    """Test the _parse_facts_xml method with malformed XML."""
    memory_block = FactExtractionMemoryBlock(llm=MockLLM())

    xml_text = """
    Some text without proper XML tags
    <fact>This should be extracted</fact>
    More text
    <fact>This should also be extracted</fact>
    """

    facts = memory_block._parse_facts_xml(xml_text)

    assert len(facts) == 2
    assert facts[0] == "This should be extracted"
    assert facts[1] == "This should also be extracted"
Test the _parse_facts_xml method with malformed XML.
llama-index-core/tests/memory/blocks/test_fact.py