static TokenNode StAX (InvarContext ctx, List<File> files) throws Exception
    {
        final TokenNode root = new TokenNode();
        final Stack<TokenNode> stack = new Stack<TokenNode>();
        final XMLInputFactory fac = XMLInputFactory.newFactory();
        fac.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
        fac.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
        fac.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
        fac.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
        fac.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
        fac.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
        for (File f : files)
        {
            //convert file to appropriate URI, f.toURI().toASCIIString()
            //converts the URI to string as per rule specified in
            //RFC 2396,
            String systemId = f.toURI().toASCIIString();
            final InputStream inp = new FileInputStream(f);
            final XMLStreamReader reader = fac.createXMLStreamReader(inp, InvarContext.encoding);
            while (reader.hasNext())
            {
                int event = reader.getEventType();
                switch (event) {
                case XMLStreamConstants.START_ELEMENT:
                    StAXStartElement(reader, stack, systemId);
                    break;
                case XMLStreamConstants.END_ELEMENT:
                    StAXEndElement(reader, stack, root);
                    break;
                case XMLStreamConstants.START_DOCUMENT:
                    String hint = "read  <- " + systemId;
                    if (!reader.getVersion().equals("1.0"))
                        throw new Exception("XML version should be 1.0\n" + event + "\n" + hint);
                    log(hint);
                    break;
                default:
                    break;
                }
                reader.next();
            }
            reader.close();
        }
        return root;
    }