Once you add an element to the adapter XML, it has no "off switch".
Also, you cannot change an adapter XML properties' values during runtime. Meaning, once the adapter is deployed, you cannot change its properties. You must re-build for new properties to be used.
That said, you can place properties in the XML and overwrite them, so that during the adapter deployment, they will change based on the environment. Which is what you've depicted in the question. That, should work.
Make sure you follow this guide, or the equivalent for the Worklight version that you are using (since you did not mention it...): Configuring an IBM Worklight project in production by using JNDI environment entries
Related questions: