Failed to load external entity when using xmlTreeParse

When I tried to use xmlTreeParse function to parse xml document, I received an error message.

 library(XML)
 url <- "http://www.w3schools.com/xml/simple.xml"
 doc <- xmlTreeParse(url, useInternal=TRUE)

The XML package has had some issues with url arguments. A simple solution is to download the XML file to your computer and use the xmlTreeParse function to parse using the filename instead of the url.

download.file(url, destfile = "foo.xml")
doc <- xmlTreeParse("foo.xml", useInternal=TRUE)

Not able to resolve this issue, after downloading Xml file also getting same error.

install.packages(“XML”)
library(XML)

fileurl1 <- “http://w3schools.com/xml/simple.xml

download.file(fileurl1, destfile = “F://simple.xml”, method = “curl”
doc <- xmlTreeParse(“F://simple.xml”, useInternalNodes = TRUE)

Extra content at the end of the document
Error: 1: Extra content at the end of the document