Load and read a local XML file

I am trying to load and read a local XML file. There is no problem when using the Servoy XML plugin

var nodes = plugins.XmlReader.readXmlDocumentFromFile('/Users/rioba/Desktop/file.xml');
var childs = nodes[0].getChildNodes();
.....

But, if I try to use Javascript functions

var xmlFile = new XML(plugins.file.readTXTFile());
var childrenList = xmlFile.children();
.....

I get, for the same file, this error

TypeError: The processing instruction target matching “[xX][mM][lL]” is not allowed. (/Users/rioba/Servoy 7/servoy_workspace/service/forms/fm_test.js#146)

Any idea of what am I doing wrong?

Hi rioba,

before parsing make, sure you remove the first line.
It’s probably something like:

<?xml version="1.0" encoding="UTF-8"?>