def _parse_dgml(
        self,
        content: bytes,
        document_name: Optional[str] = None,
        additional_doc_metadata: Optional[Mapping] = None,
    ) -> List[Document]:
        """Parse a single DGML document into a list of Documents."""
        try:
            from lxml import etree
        except ImportError:
            raise ImportError(
                "Could not import lxml python package. "
                "Please install it with `pip install lxml`."
            )
        try:
            from dgml_utils.models import Chunk
            from dgml_utils.segmentation import get_chunks
        except ImportError:
            raise ImportError(
                "Could not import from dgml-utils python package. "
                "Please install it with `pip install dgml-utils`."
            )
        def _build_framework_chunk(dg_chunk: Chunk) -> Document:
            # Stable IDs for chunks with the same text.
            _hashed_id = hashlib.md5(dg_chunk.text.encode()).hexdigest()
            metadata = {
                XPATH_KEY: dg_chunk.xpath,
                ID_KEY: _hashed_id,
                DOCUMENT_NAME_KEY: document_name,
                DOCUMENT_SOURCE_KEY: document_name,
                STRUCTURE_KEY: dg_chunk.structure,
                TAG_KEY: dg_chunk.tag,
            }
            text = dg_chunk.text
            if additional_doc_metadata:
                if self.include_project_metadata_in_doc_metadata:
                    metadata.update(additional_doc_metadata)
            return Document(
                page_content=text[: self.max_text_length],
                metadata=metadata,
            )
        # Parse the tree and return chunks
        tree = etree.parse(io.BytesIO(content))
        root = tree.getroot()
        dg_chunks = get_chunks(
            root,
            min_text_length=self.min_text_length,