I created a new user with DBA, and XDBADMIN roles granted. When I ran both the pl/sql blocks above the above code, I get the same errors.

I did try something different both as SYS and as the new user I created. Regardless of user, in in both the pl/sql blocks I added more parameters and got a different error. I have shortened the code for brevity.

I tried the code exactly the way you had it and I got the same error as before

ORA-30937: No schema definition for 'xdb.defaultTable(namespace '##local') in parent '/schema/element[1]'
ora-06512: at "xdb.dbms_xmlschema_int", line 3
ora-06512: at "xdb.dbms_xmlschema", line 14
ora-06512: at line 2

I tried the basic_message.xml file with the same parameters as you and I still get the error at line 2

I fixed the problem. After you recommended not to use the SYS account, I created an account to register the XSDs. I created an external user in the database with the DBA and XDBADMIN roles. The thing was, this external user's username was of the format DOMAINNAME\DOMAINUSERNAME. Assume that my windows Domain is called Oracle and my username is Wally, my Oracle external username is "ORACLE\WALLY" with the slash included. The STIG requirement on our project says that the domain name is to be included in the username.

I then created a regular user and granted the DBA and XDBADMIN grants. The code I included in my original post worked like a charm. I opened an SR with Oracle support and they said they will see if they can replicate the issue with the external user that has a \ in the username. Since the STIG requirement forces a \ in the username I couldn't test an external user without a \ in the username. I want to know if the issue is with the \ or with all external users.