I respectfully disagree with your claim that replacing &#x27; with &#x27;&#x27; will complete the security.  Reason: there are non-string cases, so there exists concatenations like:
&quot;WHERE SomeNumber = &quot; + inputValue + &quot; ... &quot;<p>but inputValue is a string (from untyped xml), but is put into SQL without quotes because SomeNumber is an int type in the database.  Since the xml is constructed without validation, an attacker could put any value there, including strings to inject, and do so without using quotes.