I see two issues with that approach.
First is that write to the filesystem will break the EE specification.
The other one is that *-ds.xml files are not recommended to use, instead of development environment.
Nevertheless you might store the datasource file in the standalone/deployment folder and it will be deployed automaticaly. But the behavior might be different, i.e. timing of the availibility etc..