title: XML, TypeError: Error #1088: The markup in
body: <p>Can anyone see whats wrong with either the code to grab the XML or the XML file itself? It looks well formed to me and I don't see the cause of the error:</p>
  
  <p><strong>A TypeError has occured: 
      TypeError: Error #1088: The markup in the document following the root element must be well-formed.</strong></p>
  
  <pre><code>    var file:String = 'config.xml';
      var loader:URLLoader = new URLLoader();
      var request:URLRequest = new URLRequest(file);
      loader.load(request);
      loader.addEventListener("complete", onComplete);
      loader.addEventListener("ioError", onIOError);
  
      private function onIOError(event:Event):void 
      {
          trace("IOERROR (maybe XML file does not exit or have an incorrect name)");
      }
  
      private function onComplete(event:Event):void 
      {
          var loader:URLLoader = event.target as URLLoader;
          if (loader != null) {
              try {
                  var settings:XML = new XML(loader.data);
              } catch (e:TypeError) {
                  trace("A TypeError has occured: \r\t" + e);
              }
  
          } else {
              trace("Loader is not a URLLoader!");
          }
      }
  </code></pre>
  
  <p>config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;settings&gt;
      &lt;setting1&gt;1&lt;/setting1&gt;
      &lt;showDebug&gt;2&lt;/showDebug&gt;
      &lt;someOtherSetting&gt;3&lt;/someOtherSetting&gt;
  &lt;/settings&gt;
  </code></pre>