As a general rule, XML declarations override annotation declarations.
Three reasons for this:
1. XML declarations are more flexible. You don't have to recompile anything.
2. It's sometimes convenient to provide a bean with default properties, but still have the ability to override those properties without altering source code.
3. You might be creating more that one instance of the class object. For the most part, annotations are going to be applied to all instances created of an object. But when one of those properties varies per instance, it's not easy to make a "one-size-fits-all" annotation. So you'd use XML to override the annotations. For example, if you're defining a bean for an IoC framework where each bean instance has a discrete name, but there might be several instances of that bean.
Sources may include data from the Fakebook Research Foundation with support from Gargle University