---
title: XDesignXDocument
summary: API reference for XDesignXDocument.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Services.Printing
reference_type: package
---

# XDesignXDocument

`XDesignXDocument` is the document-level XML wrapper used by the reporting workflow. It inherits the underlying SAIF XML document type and adds a `ToXpression` helper that serializes the root element through `XDesignXElement`.

## Purpose
- Represent report XML in a form that can be passed through the printing workflow.
- Convert the root element into xPression-compatible markup text.

## Context
- Namespace: `SAIF.Services.Printing.Reporting`
- Assembly/package: `SAIF.Services.Printing`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `New` | `Public Sub New()` | Creates an empty document. |
| `New` | `Public Sub New(ParamArray content() As Object)` | Creates a document initialized with content. |
| `New` | `Public Sub New(declaration As XDeclaration, content As Object())` | Creates a document with an XML declaration and content. |
| `New` | `Public Sub New(other As XDesignXDocument)` | Creates a copy of another `XDesignXDocument`. |
| `ToXpression` | `Public Function ToXpression() As String` | Serializes the root element through `XDesignXElement.ToXpression` and returns an empty string when the root is missing or not an `XDesignXElement`. |

## Behavioral notes
- `ReportBase.Render` depends on `ReportXml.ToXpression()` when it submits a preview request through `clsPrint`.

## Constraints and usage notes
- `ToXpression` only emits content when the document root is an `XDesignXElement`.

## Sources
- `Services\SAIF.Services.Printing\Reporting\XDesignXDocument.vb`
- `Services\SAIF.Services.Printing\Reporting\ReportBase.vb`
