title: Unable to parse XML from Webservice using SWXMLHash
body: <p>I have the following code using SWXMLHash - the XML parser however does not appear to be able to process it. I have checked the URL to make sure it returns data:</p>
  
  <pre><code>let baseUrl = "http://apps.hha.co.uk/mis/Api/getlivesensors.aspx?key=6fb21537-fb4e-4fe4-b07a-d8d68567c9d1"
          var request = URLRequest(url: NSURL(string: baseUrl)! as URL)
          let session = URLSession.shared
          request.httpMethod = "GET"
  
          //var err: NSError?
  
          let task = session.dataTask(with: request as URLRequest) {
              (data, response, error) in
  
              if data == nil {
                  print("dataTaskWithRequest error: \(error)")
                  return
              }
  
              let xml = SWXMLHash.parse(data!)
  
              if (xml["Sensors"]["Sensor"]["Name"].element?.text) != nil
              //if (xml["Sensors"]["Sensor"]["Name"].element?.text) != nil 
              {
                  self.sensors.add(xml["Sensors"]["Sensor"]["Name"].element?.text as Any)
              }
  
              DispatchQueue.main.async(execute : {
                  print(self.sensors)
              })
  
          }
          task.resume()
          // but obviously don't try to use it here here
  </code></pre>
  
  <p>The XML I get from the url is like this (tags are closed off - I just haven't included them):</p>
  
  <pre><code>&lt;Sensors&gt;
  &lt;Sensor&gt;
  &lt;ID&gt;12&lt;/ID&gt;
  &lt;Name&gt;EFM W.level&lt;/Name&gt;
  &lt;Series&gt;Level&lt;/Series&gt;
  &lt;Unit&gt;m&lt;/Unit&gt;
  &lt;Values&gt;
  &lt;Value CreatedOn="2017-01-08T13:50:00" Value="0.69"/&gt;
  &lt;Value CreatedOn="2017-01-08T14:00:00" Value="0.72"/&gt;
  &lt;Value CreatedOn="2017-01-08T14:10:00" Value="0.77"/&gt;
  &lt;Value CreatedOn="2017-01-08T14:20:00" Value="0.82"/&gt;
  &lt;Value CreatedOn="2017-01-08T14:30:00" Value="0.87"/&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mEtyu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mEtyu.jpg" alt="A view of the local variables as the app runs"></a></p>