title: How to convert XML to JSON with react
body: <p>I have an API that provides me XML data, and i want to convert that XML data from the API into JSON. Can anyone help me wiht that problem?</p>
  
  <p>I'm using Expo to creat a app. I tried to use nodemoduls, but when i tried that I alwas get an error "It failed because React Native does not include the Node standard library" The code belwo dosen't work</p>
  
  <pre><code>import { View, Text, ActivityIndicator } from 'react-native'
  import { fetch } from "fetch";
  const furl = 'https://skimap.org/Regions/view/346.xml';
  const xmlToJson = require('xml-to-json-stream');
  const parser = xmlToJson({attributeMode: true});
  
  export default class RegionList extends PureComponent {
  
      state = { regions: [] };
      async componentWillMount() {
          fetch(furl).then(response =&gt; parser.xmlToJson(response, (err,json)=&gt;{
              if(err){
                  console.log(err);
              }
          }))
          .then( (response) =&gt; this.setState({regions: response}));
  
      }
  </code></pre>