---
schema_version: "1"
id: 245a0d5d452dd0d88564434634f1d30934ddb15d716c90845bc17c2eebd49774
title: Reading and Writing XML Using Streams
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_xml_streaming.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_xml_streaming.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: e2f4aeff5706d22df4d84642982b5918665a30889f80bf31f172d59047270c62
description: Apex provides classes for reading and writing XML content using streams.
---
# Reading and Writing XML Using Streams

Apex provides classes for reading and writing XML content using streams.

The XMLStreamReader class enables you to read XML content and the XMLStreamWriter class enables you to write XML content.

- **[Reading XML Using Streams](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_xml_streaming_reading.htm)**  
    The XMLStreamReader class methods enable forward, read-only access to XML data.
- **[Writing XML Using Streams](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_xml_streaming_writing.htm)**  
    The XmlStreamWriter class methods enable the writing of XML data.