Xml { @UserFunction("apoc.xml.parse") @Description("RETURN apoc.xml.parse(<xml string>, <xPath string>, config, false) AS value") public Map<String, Object> parse(@Name("data") String data, @Name(value = "path", defaultValue = "/") String path, @Name(value = "config",defaultValue = "{}") Map<String, Object> config, @Name(value = "simple", defaultValue = "false") boolean simpleMode) throws Exception { if (config == null) config = Collections.emptyMap(); boolean failOnError = (boolean) config.getOrDefault("failOnError", true); return parse(new ByteArrayInputStream(data.getBytes(Charset.forName("UTF-8"))), simpleMode, path, failOnError) .map(mr -> mr.value).findFirst().orElse(null); }  @Procedure @Description("apoc.load.xml('http://example.com/test.xml', 'xPath',config, false) 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.") Stream<MapResult> xml(@Name("url") String url, @Name(value = "path", defaultValue = "/") String path, @Name(value = "config",defaultValue = "{}") Map<String, Object> config, @Name(value = "simple", defaultValue = "false") boolean simpleMode); @UserFunction("apoc.xml.parse") @Description("RETURN apoc.xml.parse(<xml string>, <xPath string>, config, false) AS value") Map<String, Object> parse(@Name("data") String data, @Name(value = "path", defaultValue = "/") String path, @Name(value = "config",defaultValue = "{}") Map<String, Object> config, @Name(value = "simple", defaultValue = "false") boolean simpleMode); @Procedure(deprecatedBy = "apoc.load.xml") @Deprecated @Description("apoc.load.xmlSimple('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 _children fields. This method does intentionally not work with XML mixed content.") Stream<MapResult> xmlSimple(@Name("url") String url); @Procedure(mode = Mode.WRITE, value = "apoc.xml.import") @Deprecated @Description("Deprecated by apoc.import.xml") Stream<NodeResult> importToGraphDeprecated(@Name("url") String url, @Name(value = "config", defaultValue = "{}") Map<String, Object> config); @Procedure(mode = Mode.WRITE, value = "apoc.import.xml") @Description("apoc.import.xml(file,config) - imports graph from provided file") Stream<NodeResult> importToGraph(@Name("url") String url, @Name(value = "config", defaultValue = "{}") Map<String, Object> config); @Context
    public ApocConfig apocConfig; @Context
    public Transaction tx; @Context
    public Log log; }
@Test public void testParse() { testCall(db, "WITH '<?xml version=\"1.0\"?><table><tr><td><img src=\"pix/logo-tl.gif\"></img></td></tr></table>' AS xmlString RETURN apoc.xml.parse(xmlString) AS value", (row) -> assertEquals(XmlTestUtils.XML_AS_SINGLE_LINE, row.get("value"))); }