void tryEncodingDecl(boolean ignoreEncoding) throws java.lang.Exception
    {
        // Read the XML/Encoding declaration.
        if (tryRead("<?xml")) {
            if (tryWhitespace()) {
                if (inputStack.size() > 0) {
                    parseTextDecl(ignoreEncoding);
                } else {
                    parseXMPDecl(ignoreEncoding);
                }
            } else {
                unread("xml".toCharArray(), 3);
                parsePI();
            }
        }
    }