# System.Xml.Linq

**Kind:** Service

**Source:** `Pams/Data/Pams.Data/Pams.Data.csproj` (line 1)

**Part of:** [Pams](subsystem-pams)

NuGet package dependency

`System.Xml.Linq` is a NuGet package dependency declared in `Pams.Data.csproj`. The data project uses it for LINQ-to-XML types and APIs when reading, creating, or transforming XML documents.

## Diagram

```mermaid
flowchart TD
    App[Application code] --> Data[Pams.Data]
    Data --> Xml[System.Xml.Linq]
    Xml --> Document[XML document processing]
```

## Usage

```typescript
// Send XML content to an API backed by Pams.Data.
// The .NET data layer can parse the payload with System.Xml.Linq.

const xml = `
<patient>
  <name>Alex Doe</name>
  <status>Active</status>
</patient>
`;

await fetch("/api/patients/import-xml", {
  method: "POST",
  headers: {
    "Content-Type": "application/xml",
  },
  body: xml,
});
```

## AI Coding Instructions

- Keep `System.Xml.Linq` references in the project file when code uses `XDocument`, `XElement`, or related XML types.
- Parse external XML defensively and validate expected elements before reading values.
- Keep XML parsing and transformation logic in the data layer rather than application callers.
- Preserve the package declaration format used by `Pams.Data.csproj` when editing this legacy project file.
