Converting Data to and from XML
- Updated2026-05-01
- 2 minute(s) read
Converting LabVIEW data to XML formats the data so that when you save the data to a file, you easily can identify the value(s), name(s), and type of the data from the tags that describe the data.
For example, if you convert an array of temperature values to XML and save that data to a text file, you easily can identify the temperature values by locating the Value tag that identifies each temperature.
To convert a LabVIEW data type to XML format, use the Flatten To XML function. For example, the block diagram does the following:
- Generates 100 simulated temperatures
- Plots the array of temperatures to a chart
- Converts the array of numbers to the XML format
- Writes the XML data to the temperatures.xml file
To convert a data type in the XML format into LabVIEW data, use the Unflatten From XML function. For example, the block diagram does the following:
- Reads the 100 temperatures in the temperatures.xml file
- Plots the array of temperatures to a chart
LabVIEW XML Schema
LabVIEW converts data to an established XML schema. Currently, you cannot create customized schemas, and you cannot control how LabVIEW tags each piece of data. Also, you cannot convert entire VIs or functions to XML.
The predefined XML schema that LabVIEW uses is LVXMLSchema.xsd, which is located in the labview\vi.lib\Utility directory. You can open the file in a text editor to read the schema.
LabVIEW XML Examples
For examples of converting to and from the XML format, refer to labview\examples\File IO\XML\Flatten and Unflatten XML\Flatten and Unflatten XML.lvproj.