In addition to that
thread from earlier this year, let me make it clear that choosing to use annotations for dependency injection does not necessarily mean that you'll be placing Spring-specific annotations in your code.
One basic thing you can do is use javax.inject annotations (@Named and @Inject) instead of Spring annotations (@Component and @Autowired). These annotations are roughly equivalent and Spring supports them. So you won't be using Spring-specific annotations, you'll be using standard "passed through the JCP" annotations.
Also, with regard to the @Component annotation, you have another option: Create your own annotation, with runtime retention and annotate it with @Component. Now your custom annotation will work in place of @Component. So the only place you're using @Component is in the definition of your custom annotation--you'll use your annotation everywhere else.
Finally, you might consider using Spring's Java-based configuration. Yes, you'll be using Spring-specific annotations, but those annotations will be confined to configuration classes (which are like Spring's XML, but expressed in
Java). Your application code won't need Spring annotations.
That said...and as I said before...use XML if you like, use annotations if you like, or use both (applying each where it makes the most sense). The nice thing is that Spring gives you the choice.