# write_xml **Descripción** Crea un archivo .data de agente en la carpeta data\_dir especificada **Parámetros**
**Nombre**
**Tipo**
**Requerido**
**Descripción**
xml
str
SiCadena XML que se escribirá en el fichero
agent_name
str
Si
Nombre del agente para el xml y nombre del fichero
data_dir
str
Si
Carpeta en la que se creará el fichero
print_errors
bool
No
Si desea imprimir mensajes de error
**Return**
fileFichero del agente
**Requisitos** - datetime.datetime - hashlib - sys **Versión** - 1.0.0 **Ejemplo** ``` import pandoraPlugintools as pt # Define the XML string to be written xml_data = """ RockyLinux HostAlive generic_proc 1 """ # Define the agent name and data directory agent_name = "RockyLinux" data_dir = '/tmp' # Write the XML data to a .data file data_file_path = pt.output.write_xml(xml_data, agent_name, data_dir) # Print the path to the created .data file print("Data file created:", data_file_path) ```