Create your custom xml file, ensure it is in res folder (I've tested this by putting it in res/values folder)
Ensure all the values you place in this XML are of a standard type.
You can then use the corresponding R call. For example for integer you do R.integer.YOUR_CUSTOM_XML_VALUE. Doesn't matter which xml this integer is located in, it will be registered by R as long as it is in res folder.