// @generated by openehr-codegen (emit-aom2) — DO NOT EDIT.
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0
//! openEHR AOM2 persistent-form archetype model + canonical-XML codec.
//!
//! Parse a persistent-form AOM2 archetype with [`from_xml`]; the root element is `<archetype>` (`P_AUTHORED_ARCHETYPE`).
//!
//! This is the PERSISTENT (`P_AOM`) AOM2 serialization — `P_Archetype.xsd`, whose
//! own header calls it "uses P_AOM types - much more space efficient". It is the
//! form the bundle's 8 `AOM2/examples/*.xml` documents carry
//! (`xsi:schemaLocation="… ../P_Archetype.xsd"`). The bundle's other archetype
//! serialization — the AOM model form — is [`crate::aom2_model`].
/// Parse a persistent-form AOM2 archetype XML document into a [`types::PAuthoredArchetype`].
///
/// # Errors
/// Propagates canonical-XML parse errors, and refuses a root element other
/// than `<archetype>`.
/// Serialize a [`types::PAuthoredArchetype`] back to AOM2 persistent-form archetype XML (root `<archetype>`,
/// `http://schemas.openehr.org/v1`).
///
/// # Errors
/// Propagates canonical-XML serialization errors.