class_docstr: Interface used to load a streaming :class:`DataFrame <pyspark.sql.DataFrame>` from external
  storage systems (e.g. file systems, key-value stores, etc).
  Use :attr:`SparkSession.readStream <pyspark.sql.SparkSession.readStream>` to access this.
  
  .. versionadded:: 2.0.0
  
  .. versionchanged:: 3.5.0
      Supports Spark Connect.
  
  Notes
  -----
  This API is evolving.
  
  Examples
  --------
  >>> spark.readStream
  <...streaming.readwriter.DataStreamReader object ...>
  
  The example below uses Rate source that generates rows continuously.
  After that, we operate a modulo by 3, and then writes the stream out to the console.
  The streaming query stops in 3 seconds.
  
  >>> import time
  >>> df = spark.readStream.format("rate").load()
  >>> df = df.selectExpr("value % 3 as v")
  >>> q = df.writeStream.format("console").start()
  >>> time.sleep(3)
  >>> q.stop()
class_docstr_tok: ["Interface","used","to","load","a","streaming",":","class",":","`","DataFrame","<","pyspark.sql.DataFrame",">","`","from","external","storage","systems","(","e.g",".","file","systems",",","key-value","stores",",","etc",")",".","Use",":","attr",":","`","SparkSession.readStream","<","pyspark.sql.SparkSession.readStream",">","`","to","access","this",".","..","versionadded",":",":","2.0.0","..","versionchanged",":",":","3.5.0","Supports","Spark","Connect",".","Notes","--","--","-","This","API","is","evolving",".","Examples","--","--","--","--",">",">",">","spark.readStream","<","...","streaming.readwriter.DataStreamReader","object","...",">","The","example","below","uses","Rate","source","that","generates","rows","continuously",".","After","that",",","we","operate","a","modulo","by","3",",","and","then","writes","the","stream","out","to","the","console",".","The","streaming","query","stops","in","3","seconds",".",">",">",">","import","time",">",">",">","df","=","spark.readStream.format","(","``","rate","''",")",".load","(",")",">",">",">","df","=","df.selectExpr","(","``","value","%","3","as","v","''",")",">",">",">","q","=","df.writeStream.format","(","``","console","''",")",".start","(",")",">",">",">","time.sleep","(","3",")",">",">",">","q.stop","(",")"]
docstr: Loads a XML file stream and returns the result as a :class:`DataFrame`.
  
  If the ``schema`` parameter is not specified, this function goes
  through the input once to determine the input schema.
  
  Parameters
  ----------
  path : str
      string for input path.
  schema : :class:`pyspark.sql.types.StructType` or str, optional
      an optional :class:`pyspark.sql.types.StructType` for the input schema
      or a DDL-formatted string (For example ``col0 INT, col1 DOUBLE``).
  
  .. versionadded:: 4.0.0
  
  Other Parameters
  ----------------
  Extra options
      For the extra options, refer to
      `Data Source Option <https://spark.apache.org/docs/latest/sql-data-sources-xml.html#data-source-option>`_
      in the version you use.
  
      .. # noqa
  
  Notes
  -----
  This API is evolving.
  
  Examples
  --------
  Write a DataFrame into a XML file and read it back.
  
  >>> import tempfile
  >>> import time
  >>> with tempfile.TemporaryDirectory() as d:
  ...     # Write a DataFrame into a XML file
  ...     spark.createDataFrame(
  ...         [{"age": 100, "name": "Hyukjin Kwon"}]
  ...     ).write.mode("overwrite").option("rowTag", "person").xml(d)
  ...
  ...     # Start a streaming query to read the XML file.
  ...     q = spark.readStream.schema(
  ...         "age INT, name STRING"
  ...     ).xml(d, rowTag="person").writeStream.format("console").start()
  ...     time.sleep(3)
  ...     q.stop()
docstr_tok: ["Loads","a","XML","file","stream","and","returns","the","result","as","a",":","class",":","`","DataFrame","`",".","If","the","``","schema","``","parameter","is","not","specified",",","this","function","goes","through","the","input","once","to","determine","the","input","schema",".","Parameters","--","--","--","--","--","path",":","str","string","for","input","path",".","schema",":",":","class",":","`","pyspark.sql.types.StructType","`","or","str",",","optional","an","optional",":","class",":","`","pyspark.sql.types.StructType","`","for","the","input","schema","or","a","DDL-formatted","string","(","For","example","``","col0","INT",",","col1","DOUBLE","``",")",".","..","versionadded",":",":","4.0.0","Other","Parameters","--","--","--","--","--","--","--","--","Extra","options","For","the","extra","options",",","refer","to","`","Data","Source","Option","<","https",":","\/\/spark.apache.org\/docs\/latest\/sql-data-sources-xml.html","#","data-source-option",">","`","_","in","the","version","you","use",".","..","#","noqa","Notes","--","--","-","This","API","is","evolving",".","Examples","--","--","--","--","Write","a","DataFrame","into","a","XML","file","and","read","it","back",".",">",">",">","import","tempfile",">",">",">","import","time",">",">",">","with","tempfile.TemporaryDirectory","(",")","as","d",":","...","#","Write","a","DataFrame","into","a","XML","file","...","spark.createDataFrame","(","...","[","{","``","age","''",":","100",",","``","name","''",":","``","Hyukjin","Kwon","''","}","]","...",")",".write.mode","(","``","overwrite","''",")",".option","(","``","rowTag","''",",","``","person","''",")",".xml","(","d",")","...","...","#","Start","a","streaming","query","to","read","the","XML","file",".","...","q","=","spark.readStream.schema","(","...","``","age","INT",",","name","STRING","''","...",")",".xml","(","d",",","rowTag=","''","person","''",")",".writeStream.format","(","``","console","''",")",".start","(",")","...","time.sleep","(","3",")","...","q.stop","(",")"]
code: def xml(
      self,
      path: str,
      rowTag: Optional[str] = None,
      schema: Optional[Union[StructType, str]] = None,
      excludeAttribute: Optional[Union[bool, str]] = None,
      attributePrefix: Optional[str] = None,
      valueTag: Optional[str] = None,
      ignoreSurroundingSpaces: Optional[Union[bool, str]] = None,
      rowValidationXSDPath: Optional[str] = None,
      ignoreNamespace: Optional[Union[bool, str]] = None,
      wildcardColName: Optional[str] = None,
      encoding: Optional[str] = None,
      inferSchema: Optional[Union[bool, str]] = None,
      nullValue: Optional[str] = None,
      dateFormat: Optional[str] = None,
      timestampFormat: Optional[str] = None,
      mode: Optional[str] = None,
      columnNameOfCorruptRecord: Optional[str] = None,
      multiLine: Optional[Union[bool, str]] = None,
      samplingRatio: Optional[Union[float, str]] = None,
      locale: Optional[str] = None,
  ) -> "DataFrame":
      r"""Loads a XML file stream and returns the result as a :class:`DataFrame`.
  
      If the ``schema`` parameter is not specified, this function goes
      through the input once to determine the input schema.
  
      Parameters
      ----------
      path : str
          string for input path.
      schema : :class:`pyspark.sql.types.StructType` or str, optional
          an optional :class:`pyspark.sql.types.StructType` for the input schema
          or a DDL-formatted string (For example ``col0 INT, col1 DOUBLE``).
  
      .. versionadded:: 4.0.0
  
      Other Parameters
      ----------------
      Extra options
          For the extra options, refer to
          `Data Source Option <https://spark.apache.org/docs/latest/sql-data-sources-xml.html#data-source-option>`_
          in the version you use.
  
          .. # noqa
  
      Notes
      -----
      This API is evolving.
  
      Examples
      --------
      Write a DataFrame into a XML file and read it back.
  
      >>> import tempfile
      >>> import time
      >>> with tempfile.TemporaryDirectory() as d:
      ...     # Write a DataFrame into a XML file
      ...     spark.createDataFrame(
      ...         [{"age": 100, "name": "Hyukjin Kwon"}]
      ...     ).write.mode("overwrite").option("rowTag", "person").xml(d)
      ...
      ...     # Start a streaming query to read the XML file.
      ...     q = spark.readStream.schema(
      ...         "age INT, name STRING"
      ...     ).xml(d, rowTag="person").writeStream.format("console").start()
      ...     time.sleep(3)
      ...     q.stop()
      """
      self._set_opts(
          rowTag=rowTag,
          schema=schema,
          excludeAttribute=excludeAttribute,
          attributePrefix=attributePrefix,
          valueTag=valueTag,
          ignoreSurroundingSpaces=ignoreSurroundingSpaces,
          rowValidationXSDPath=rowValidationXSDPath,
          ignoreNamespace=ignoreNamespace,
          wildcardColName=wildcardColName,
          encoding=encoding,
          inferSchema=inferSchema,
          nullValue=nullValue,
          dateFormat=dateFormat,
          timestampFormat=timestampFormat,
          mode=mode,
          columnNameOfCorruptRecord=columnNameOfCorruptRecord,
          multiLine=multiLine,
          samplingRatio=samplingRatio,
          locale=locale,
      )
      if isinstance(path, str):
          return self._df(self._jreader.xml(path))
      else:
          raise PySparkTypeError(
              error_class="NOT_STR",
              message_parameters={
                  "arg_name": "path",
                  "arg_type": type(path).__name__,
              },
          )
  
imports: import sys
  from collections.abc import Iterator
  from typing import cast, overload, Any, Callable, List, Optional, TYPE_CHECKING, Union
  from py4j.java_gateway import java_import, JavaObject
  from pyspark.sql.column import _to_seq
  from pyspark.sql.readwriter import OptionUtils, to_str
  from pyspark.sql.streaming.query import StreamingQuery
  from pyspark.sql.types import Row, StructType
  from pyspark.sql.utils import ForeachBatchFunction
  from pyspark.errors import PySparkTypeError, PySparkValueError, PySparkAttributeError, PySparkRuntimeError
label_desc: Use image node_id 13 for calling the DataStreamReader obj's underlying member method code with example usage: obj.xml(path, rowTag, schema, excludeAttribute, attributePrefix, valueTag, ignoreSurroundingSpaces, rowValidationXSDPath, ignoreNamespace, wildcardColName, encoding, inferSchema, nullValue, dateFormat, timestampFormat, mode, columnNameOfCorruptRecord, multiLine, samplingRatio, locale) and returns: self