Here (and not only there) people are using the following code to handle an error from sp_xml_preparedocument
EXEC @err = sp_xml_preparedocument @hdoc OUTPUT, @xmlDoc
SELECT @err = @@error + coalesce(@err, 4711)
Are there any reasons for this? And what does 4711 mean in this context?