xml.hpp(3) Library Functions Manual xml.hpp(3)

# [NAME](#NAME)

xml.hpp - XML input and output archives.

# [SYNOPSIS](#SYNOPSIS)

#include 'cereal/cereal.hpp'  
#include 'cereal/details/util.hpp'  
#include 'cereal/external/rapidxml/rapidxml.hpp'  
#include 'cereal/external/rapidxml/rapidxml\_print.hpp'  
#include 'cereal/external/base64.hpp'  
#include &lt;sstream&gt;  
#include &lt;stack&gt;  
#include &lt;vector&gt;  
#include &lt;limits&gt;  
#include &lt;string&gt;  
#include &lt;cstring&gt;  
#include &lt;cmath&gt;

## [Classes](#Classes)

class **cereal::XMLOutputArchive**  
An output archive designed to save data to XML. class **cereal::XMLOutputArchive::Options**  
A class containing various advanced options for the XML archive. struct **cereal::XMLOutputArchive::NodeInfo**  
A struct that contains metadata about a node. class **cereal::XMLInputArchive**  
An output archive designed to load data from XML. struct **cereal::XMLInputArchive::NodeInfo**  
A struct that contains metadata about a node.

## [Macros](#Macros)

#define **CEREAL\_XML\_STRING\_VALUE** 'cereal'  
The default name for the root node in a cereal xml archive.

## [Functions](#Functions)

bool **cereal::xml\_detail::isWhitespace** (char c)  
Returns true if the character is whitespace. template&lt;class T&gt; void **cereal::prologue** (**XMLOutputArchive** &, **NameValuePair**&lt; T &gt; const &)  
Prologue for NVPs for XML output archives. template&lt;class T&gt; void **cereal::prologue** (**XMLInputArchive** &, **NameValuePair**&lt; T &gt; const &)  
Prologue for NVPs for XML input archives. template&lt;class T&gt; void **cereal::epilogue** (**XMLOutputArchive** &, **NameValuePair**&lt; T &gt; const &)  
Epilogue for NVPs for XML output archives. template&lt;class T&gt; void **cereal::epilogue** (**XMLInputArchive** &, **NameValuePair**&lt; T &gt; const &)  
Epilogue for NVPs for XML input archives. template&lt;class T&gt; void **cereal::prologue** (**XMLOutputArchive** &, **DeferredData**&lt; T &gt; const &)  
Prologue for deferred data for XML archives. template&lt;class T&gt; void **cereal::prologue** (**XMLInputArchive** &, **DeferredData**&lt; T &gt; const &)  
Prologue for deferred data for XML archives. template&lt;class T&gt; void **cereal::epilogue** (**XMLOutputArchive** &, **DeferredData**&lt; T &gt; const &)  
Epilogue for deferred for XML archives. template&lt;class T&gt; void **cereal::epilogue** (**XMLInputArchive** &, **DeferredData**&lt; T &gt; const &)  
Epilogue for deferred for XML archives. template&lt;class T&gt; void **cereal::prologue** (**XMLOutputArchive** &ar, **SizeTag**&lt; T &gt; const &)  
Prologue for SizeTags for XML output archives. template&lt;class T&gt; void **cereal::prologue** (**XMLInputArchive** &, **SizeTag**&lt; T &gt; const &)  
template&lt;class T&gt; void **cereal::epilogue** (**XMLOutputArchive** &, **SizeTag**&lt; T &gt; const &)  
Epilogue for SizeTags for XML output archives. template&lt;class T&gt; void **cereal::epilogue** (**XMLInputArchive** &, **SizeTag**&lt; T &gt; const &)  
template&lt;class T, traits::DisableIf&lt; **traits::has\_minimal\_base\_class\_serialization**&lt; T, **traits::has\_minimal\_output\_serialization**, **XMLOutputArchive** &gt;::value||**traits::has\_minimal\_output\_serialization**&lt; T, **XMLOutputArchive** &gt;::value &gt; = traits::sfinae&gt; void **cereal::prologue** (**XMLOutputArchive** &ar, T const &)  
Prologue for all other types for XML output archives (except minimal types). template&lt;class T, traits::DisableIf&lt; **traits::has\_minimal\_base\_class\_serialization**&lt; T, **traits::has\_minimal\_input\_serialization**, **XMLInputArchive** &gt;::value||**traits::has\_minimal\_input\_serialization**&lt; T, **XMLInputArchive** &gt;::value &gt; = traits::sfinae&gt; void **cereal::prologue** (**XMLInputArchive** &ar, T const &)  
Prologue for all other types for XML input archives (except minimal types). template&lt;class T, traits::DisableIf&lt; **traits::has\_minimal\_base\_class\_serialization**&lt; T, **traits::has\_minimal\_output\_serialization**, **XMLOutputArchive** &gt;::value||**traits::has\_minimal\_output\_serialization**&lt; T, **XMLOutputArchive** &gt;::value &gt; = traits::sfinae&gt; void **cereal::epilogue** (**XMLOutputArchive** &ar, T const &)  
Epilogue for all other types other for XML output archives (except minimal types). template&lt;class T, traits::DisableIf&lt; **traits::has\_minimal\_base\_class\_serialization**&lt; T, **traits::has\_minimal\_input\_serialization**, **XMLInputArchive** &gt;::value||**traits::has\_minimal\_input\_serialization**&lt; T, **XMLInputArchive** &gt;::value &gt; = traits::sfinae&gt; void **cereal::epilogue** (**XMLInputArchive** &ar, T const &)  
Epilogue for all other types other for XML output archives (except minimal types). template&lt;class T&gt; void **cereal::CEREAL\_SAVE\_FUNCTION\_NAME** (**XMLOutputArchive** &ar, **NameValuePair**&lt; T &gt; const &t)  
Saving NVP types to XML. template&lt;class T&gt; void **cereal::CEREAL\_LOAD\_FUNCTION\_NAME** (**XMLInputArchive** &ar, **NameValuePair**&lt; T &gt; &t)  
Loading NVP types from XML. template&lt;class T&gt; void **cereal::CEREAL\_SAVE\_FUNCTION\_NAME** (**XMLOutputArchive** &, **SizeTag**&lt; T &gt; const &)  
Saving SizeTags to XML. template&lt;class T&gt; void **cereal::CEREAL\_LOAD\_FUNCTION\_NAME** (**XMLInputArchive** &ar, **SizeTag**&lt; T &gt; &st)  
Loading SizeTags from XML. template&lt;class T, traits::EnableIf&lt; std::is\_arithmetic&lt; T &gt;::value &gt; = traits::sfinae&gt; void **cereal::CEREAL\_SAVE\_FUNCTION\_NAME** (**XMLOutputArchive** &ar, T const &t)  
Saving for POD types to xml. template&lt;class T, traits::EnableIf&lt; std::is\_arithmetic&lt; T &gt;::value &gt; = traits::sfinae&gt; void **cereal::CEREAL\_LOAD\_FUNCTION\_NAME** (**XMLInputArchive** &ar, T &t)  
Loading for POD types from xml. template&lt;class CharT, class Traits, class Alloc&gt; void **cereal::CEREAL\_SAVE\_FUNCTION\_NAME** (**XMLOutputArchive** &ar, std::basic\_string&lt; CharT, Traits, Alloc &gt; const &str)  
saving string to xml template&lt;class CharT, class Traits, class Alloc&gt; void **cereal::CEREAL\_LOAD\_FUNCTION\_NAME** (**XMLInputArchive** &ar, std::basic\_string&lt; CharT, Traits, Alloc &gt; &str)  
loading string from xml

# [Detailed Description](#Detailed_Description)

XML input and output archives.

# [Macro Definition Documentation](#Macro_Definition_Documentation)

## [#define CEREAL\_XML\_STRING\_VALUE 'cereal'](#_define_CEREAL_XML_STRING_VALUE___'cereal')

The default name for the root node in a cereal xml archive. You can define CEREAL\_XML\_STRING\_VALUE to be different assuming you do so before this file is included.

# [Function Documentation](#Function_Documentation)

## template&lt;class T&gt; void cereal::epilogue (**XMLInputArchive** & , **DeferredData**&lt; T &gt; const & ) \[inline]

Epilogue for deferred for XML archives. Do nothing for the defer wrapper

## template&lt;class T&gt; void cereal::epilogue (**XMLOutputArchive** & , **DeferredData**&lt; T &gt; const & ) \[inline]

Epilogue for deferred for XML archives. NVPs do not start or finish nodes - they just set up the names

## template&lt;class T&gt; void cereal::epilogue (**XMLOutputArchive** & , **NameValuePair**&lt; T &gt; const & ) \[inline]

Epilogue for NVPs for XML output archives. NVPs do not start or finish nodes - they just set up the names

## template&lt;class T&gt; void cereal::epilogue (**XMLOutputArchive** & , **SizeTag**&lt; T &gt; const & ) \[inline]

Epilogue for SizeTags for XML output archives. SizeTags do not start or finish nodes

## template&lt;class T, **traits::DisableIf**&lt; traits::has\_minimal\_base\_class\_serialization&lt; T, traits::has\_minimal\_output\_serialization, XMLOutputArchive &gt;::value||traits::has\_minimal\_output\_serialization&lt; T, XMLOutputArchive &gt;::value &gt; = traits::sfinae&gt; void cereal::epilogue (**XMLOutputArchive** & ar, T const & ) \[inline]

Epilogue for all other types other for XML output archives (except minimal types). Finishes the node created in the prologue

Minimal types do not start or end nodes

## template&lt;class T&gt; void cereal::prologue (**XMLOutputArchive** & , **DeferredData**&lt; T &gt; const & ) \[inline]

Prologue for deferred data for XML archives. Do nothing for the defer wrapper

## template&lt;class T&gt; void cereal::prologue (**XMLOutputArchive** & , **NameValuePair**&lt; T &gt; const & ) \[inline]

Prologue for NVPs for XML output archives. NVPs do not start or finish nodes - they just set up the names

## template&lt;class T&gt; void cereal::prologue (**XMLOutputArchive** & ar, **SizeTag**&lt; T &gt; const & ) \[inline]

Prologue for SizeTags for XML output archives. SizeTags do not start or finish nodes

## template&lt;class T, **traits::DisableIf**&lt; traits::has\_minimal\_base\_class\_serialization&lt; T, traits::has\_minimal\_output\_serialization, XMLOutputArchive &gt;::value||traits::has\_minimal\_output\_serialization&lt; T, XMLOutputArchive &gt;::value &gt; = traits::sfinae&gt; void cereal::prologue (**XMLOutputArchive** & ar, T const & ) \[inline]

Prologue for all other types for XML output archives (except minimal types). Starts a new node, named either automatically or by some NVP, that may be given data by the type about to be archived

Minimal types do not start or end nodes

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Mon Oct 26 2026 02:55:37 cereal

---

Document: xml.hpp(3) from cereal 1.3.2-r7 (Chainguard OS)
Source: https://github.com/USCiLab/cereal
