LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coreoutput_parsersxmlXMLOutputParserparser
    Attribute●Since v0.1

    parser

    Parser to use for XML parsing.

    Can be either 'defusedxml' or 'xml'.

    • 'defusedxml' is the default parser and is used to prevent XML vulnerabilities present in some distributions of Python's standard library xml. defusedxml is a wrapper around the standard library parser that sets up the parser with secure defaults.
    • 'xml' is the standard library parser.
    Warning

    Use xml only if you are sure that your distribution of the standard library is not vulnerable to XML vulnerabilities.

    Review the following resources for more information:

    • https://docs.python.org/3/library/xml.html#xml-vulnerabilities
    • https://github.com/tiran/defusedxml

    The standard library relies on libexpat for parsing XML.

    Copy
    parser: Literal['defusedxml', 'xml'] = 'defusedxml'
    View source on GitHub