public static final XMLInputFactory FACTORY = XMLInputFactory.newFactory();
@Context public GraphDatabaseService db;
@Procedure
@Description("apoc.load.xml('http://example.com/test.xml') YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _childrenx fields.")
public Stream<MapResult> xml(@Name("url") String url) {
<BUG>try {
URLConnection urlConnection = new URL(url).openConnection();</BUG>
FACTORY.setProperty("javax.xml.stream.isCoalescing", true);
XMLStreamReader reader = FACTORY.createXMLStreamReader(urlConnection.getInputStream());
if (reader.nextTag()==XMLStreamConstants.START_ELEMENT) {

public static final XMLInputFactory FACTORY = XMLInputFactory.newFactory();
@Context public GraphDatabaseService db;
@Procedure
@Description("apoc.load.xml('http://example.com/test.xml') YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _childrenx fields.")
public Stream<MapResult> xml(@Name("url") String url) {
try {
FileUtils.checkReadAllowed(url);
URLConnection urlConnection = new URL(url).openConnection();
FACTORY.setProperty("javax.xml.stream.isCoalescing", true);
XMLStreamReader reader = FACTORY.createXMLStreamReader(urlConnection.getInputStream());
if (reader.nextTag()==XMLStreamConstants.START_ELEMENT) {
