title: Unable to extract xml data from website using JAVA
body: <p>I'm trying to extract data for the hotel names at the given latitude and longitude in JAVA. I'm getting the following error: [Fatal Error] :1:1: Content is not allowed in prolog.
  Here is the code and the URL from where I am trying to extract my information. Any suggestion about the issue?</p>
  
  <pre><code>              URL url = new URL("https://api.eancdn.com/ean-services/rs/hotel/v3/list?apiKey=vkndmgahz5aekd65pxg4rvvp&amp;locale=en_US&amp;currencyCode=USD&amp;latitude=51.514&amp;longitude=-0.269"");
                InputStream is = url.openStream();
                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DocumentBuilder db = dbf.newDocumentBuilder();
                Document doc = db.parse(is);
  
                  NodeList itemList = 
                          doc.getElementsByTagName("HotelSummary");
                  Node itemNode;
                  Element itemElt;
  
  
                  for(int k=0; k &lt; itemList.getLength(); k++)
                  {
                      itemNode = itemList.item(k);
  
                      if(itemNode.getNodeType() == Node.ELEMENT_NODE) {
                          itemElt = (Element) itemNode;
                          System.out.println("Hotel name: "+itemElt.getElementsByTagName("name").item(0).getTextContent());
  </code></pre>