### Apache Airflow version

Other Airflow 2 version (please specify below)

### What happened

Airflow 2.3.4 (but actual code seems to have same behaviour).

I have mapped task with xcom value.

I want to get xcom value of particular instance or xcom values of all task instances.

I am using standard REST API method /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}

And it throws an error
`
  File &#34;/home/airflow/.local/lib/python3.9/site-packages/sqlalchemy/orm/query.py&#34;, line 2850, in one_or_none
    return self._iter().one_or_none()
  File &#34;/home/airflow/.local/lib/python3.9/site-packages/sqlalchemy/engine/result.py&#34;, line 1510, in one_or_none
    return self._only_one_row(
  File &#34;/home/airflow/.local/lib/python3.9/site-packages/sqlalchemy/engine/result.py&#34;, line 614, in _only_one_row
    raise exc.MultipleResultsFound(
sqlalchemy.exc.MultipleResultsFound: Multiple rows were found when one or none was required
`

Is it any way of getting xcom of mapped tasks via API?

### What you think should happen instead

_No response_

### How to reproduce

Make dag with mapped task. Return xcom value in every task. Try to get xcom value via API.

### Operating System

ubuntu 20.04

### Versions of Apache Airflow Providers

_No response_

### Deployment

Other

### Deployment details

Standard

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

"""Get all XCom values."""
    query = select(XCom)
    if dag_id == "~":
        appbuilder = get_airflow_app().appbuilder
        readable_dag_ids = appbuilder.sm.get_readable_dag_ids(g.user)
        query = query.where(XCom.dag_id.in_(readable_dag_ids))
        query = query.join(DR, and_(XCom.dag_id == DR.dag_id, XCom.run_id == DR.run_id))
    else:
        query = query.where(XCom.dag_id == dag_id)
        query = query.join(DR, and_(XCom.dag_id == DR.dag_id, XCom.run_id == DR.run_id))
    if task_id != "~":
        query = query.where(XCom.task_id == task_id)
    if dag_run_id != "~":
        query = query.where(DR.run_id == dag_run_id)
    query = query.order_by(DR.execution_date, XCom.task_id, XCom.dag_id, XCom.key)
    total_entries = session.execute(select(func.count()).select_from(query)).scalar()
    query = session.scalars(query.offset(offset).limit(limit))
    return xcom_collection_schema.dump(XComCollection(xcom_entries=query, total_entries=total_entries))
@security.requires_access(
    [
        (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG),
        (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG_RUN),
        (permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE),
        (permissions.ACTION_CAN_READ, permissions.RESOURCE_XCOM),
    ],
)
@provide_session
def get_xcom_entry(
    *,
    dag_id: str,