title: React-Native fetch XML data
body: <p>I'm new to React-Native. Trying to make some very simple apps. Can't figure out how to fetch XML data. With JSON everything is clear and simple. </p>
  
  <p>But how to fetch XML? Tried to convert it to JSON via <a href="http://goessner.net/download/prj/jsonxml/" rel="noreferrer">this</a> and some other similar scripts, but without any success. Need help :/</p>
  
  <p>My code looks very simple:</p>
  
  <pre><code>var xml_url = 'http://api.example.com/public/all.xml';
  
  var ExampleProject = React.createClass({
      getInitialState: function() {
      return {
        data: {results:{}},
      };
    },
    componentDidMount: function() {
      this.fetchData();
    },
    fetchData: function() {
      fetch(xml_url)
        .then((response) =&gt; response.json())
        .then((responseData) =&gt; {
          this.setState({
            data: responseData.data,
          });
        })
        .done();
    },
  
    render: function() {
      return (
        &lt;View style={styles.wrapper}&gt;
          &lt;View style={styles.container}&gt;
            &lt;View style={styles.box}&gt;
              &lt;Text style={styles.heading}&gt;Heading&lt;/Text&gt;
              &lt;Text&gt;Some text&lt;/Text&gt;
            &lt;/View&gt;
          &lt;/View&gt;
        &lt;/View&gt;
      );
    },
  });
  </code></pre>