When the length of p_xml would be an exact multitude of 4000 the loop
over chunks would execute one time too much, causing "ORA-06502: PLSQL:
numeric of value error: invalid LOB locator specified: ORA-22275",
because the second part of dbms_lob.append would be NULL. A check is
added on the length of the clob and if if the mod of 4000 is zero, we
decrease the amount of loops by one.