diff -U3 /build/postgresql/src/postgresql-16.3/src/test/regress/expected/xml.out /build/postgresql/src/postgresql-16.3/src/test/regress/results/xml.out
--- /build/postgresql/src/postgresql-16.3/src/test/regress/expected/xml.out	2024-06-30 18:20:22.000000000 +0000
+++ /build/postgresql/src/postgresql-16.3/src/test/regress/results/xml.out	2024-06-30 18:22:04.688198351 +0000
@@ -254,23 +254,13 @@
 DETAIL:  line 1: xmlParseEntityRef: no name
 <invalidentity>&</invalidentity>
                 ^
-line 1: chunk is not well balanced
-<invalidentity>&</invalidentity>
-                                ^
 SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
 ERROR:  invalid XML content
 DETAIL:  line 1: Entity 'idontexist' not defined
 <undefinedentity>&idontexist;</undefinedentity>
                              ^
-line 1: chunk is not well balanced
-<undefinedentity>&idontexist;</undefinedentity>
-                                               ^
 SELECT xmlparse(content '<invalidns xmlns=''&lt;''/>');
-         xmlparse          
----------------------------
- <invalidns xmlns='&lt;'/>
-(1 row)
-
+ERROR:  invalid XML content
 SELECT xmlparse(content '<relativens xmlns=''relative''/>');
             xmlparse            
 --------------------------------
@@ -285,15 +275,8 @@
 line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
 <twoerrors>&idontexist;</unbalanced>
                                     ^
-line 1: chunk is not well balanced
-<twoerrors>&idontexist;</unbalanced>
-                                    ^
 SELECT xmlparse(content '<nosuchprefix:tag/>');
-      xmlparse       
----------------------
- <nosuchprefix:tag/>
-(1 row)
-
+ERROR:  invalid XML content
 SELECT xmlparse(document '   ');
 ERROR:  invalid XML document
 DETAIL:  line 1: Start tag expected, '<' not found
@@ -525,25 +508,18 @@
 SELECT xmlserialize(DOCUMENT '<foo>73</foo><bar><val x="y">42</val></bar>' AS text INDENT);
 ERROR:  not an XML document
 SELECT xmlserialize(CONTENT  '<foo>73</foo><bar><val x="y">42</val></bar>' AS text INDENT);
-     xmlserialize      
------------------------
- <foo>73</foo>        +
- <bar>                +
-   <val x="y">42</val>+
- </bar>
+ xmlserialize  
+---------------
+ <foo>73</foo>
 (1 row)
 
 -- indent non singly-rooted xml with mixed contents
 SELECT xmlserialize(DOCUMENT 'text node<foo>73</foo>text node<bar><val x="y">42</val></bar>' AS text INDENT);
 ERROR:  not an XML document
 SELECT xmlserialize(CONTENT  'text node<foo>73</foo>text node<bar><val x="y">42</val></bar>' AS text INDENT);
-      xmlserialize      
-------------------------
- text node             +
- <foo>73</foo>text node+
- <bar>                 +
-   <val x="y">42</val> +
- </bar>
+ xmlserialize 
+--------------
+ text node
 (1 row)
 
 -- indent singly-rooted xml with mixed contents
@@ -1209,15 +1185,13 @@
 -- error messages, we suppress the DETAIL in this test.
 \set VERBOSITY terse
 SELECT xpath('/*', '<invalidns xmlns=''&lt;''/>');
-ERROR:  could not parse XML document
+ERROR:  invalid XML content at character 20
 \set VERBOSITY default
 -- Again, the XML isn't well-formed for namespace purposes
 SELECT xpath('/*', '<nosuchprefix:tag/>');
-ERROR:  could not parse XML document
-DETAIL:  line 1: Namespace prefix nosuchprefix on tag is not defined
-<nosuchprefix:tag/>
-                 ^
-CONTEXT:  SQL function "xpath" statement 1
+ERROR:  invalid XML content
+LINE 1: SELECT xpath('/*', '<nosuchprefix:tag/>');
+                           ^
 -- XPath deprecates relative namespaces, but they're not supposed to
 -- throw an error, only a warning.
 SELECT xpath('/*', '<relativens xmlns=''relative''/>');