title: parsing XML columns from PySpark Dataframe using UDF
body: <p>I have a scenario where I have XML data in a dataframe column.</p>
  <pre><code>+-----------+----------+----------+--------------------+----+----------+--------+---+------------------+----------+--------------------+----+
  |     county|created_at|first_name|                  id|meta|name_count|position|sex|               sid|updated_at|            visitors|year|
  +-----------+----------+----------+--------------------+----+----------+--------+---+------------------+----------+--------------------+----+
  |      KINGS|1574264158|      ZOEY|00000000-0000-000...| { }|        11|       0|  F|row-r9pv-p86t.ifsp|1574264158|&lt;?xml version=&quot;1....|2007|
  </code></pre>
  <p>I want to parse - <code>Visitors</code> column -  the nested XML fields into columns in Dataframe using UDF</p>
  <p>Format of XML -</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;visitors&gt; &lt;visitor id=&quot;9615&quot; age=&quot;68&quot; sex=&quot;F&quot; /&gt; &lt;visitor id=&quot;1882&quot; age=&quot;34&quot; sex=&quot;M&quot; /&gt; &lt;visitor id=&quot;5987&quot; age=&quot;23&quot; sex=&quot;M&quot; /&gt; &lt;/visitors&gt;
  </code></pre>