I am not sure what the XML you showed us has to do with gradients. You can define a gradient in an XML file in your drawable folder:
drawable
(for example, save this as my_gradient.xml)
my_gradient.xml
Then in your layout xml file you can have: