Question: I have been learning on jax-rs. My problem is i don't know how to choose either application/XML or text/XML even i read more articles about them in Internet. Can anyone describe it simply like what application/XML support and not? why I should use text/XML?

Answer: 
The `text/xml` media type is an **alias** for the `application/xml` media type.

Check the [RFC 7303](https://www.rfc-editor.org/rfc/rfc7303) for details:

> 
> [**9.1. application/xml Registration**](https://www.rfc-editor.org/rfc/rfc7303#section-9.1)
> 
> 
> Type name: application
> 
> 
> Subtype name: xml
> 
> 
> [...]
> 
> 
> 

> 
> [**9.2. text/xml Registration**](https://www.rfc-editor.org/rfc/rfc7303#section-9.2)
> 
> 
> The registration information for `text/xml` is in all respects the same
> as that given for application/xml above ([Section 9.1](https://www.rfc-editor.org/rfc/rfc7303#section-9.1)), except that
> the "Type name" is "text".
> 
> 
> 

In JAX-RS, you can use the following to support both:

```java
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public Response foo() {
    ...
}

```
I think they answer your question here [What's the difference between text/xml vs application/xml for webservice response](https://stackoverflow.com/questions/4832357/whats-the-difference-between-text-xml-vs-application-xml-for-webservice-respons)

In practice it all depends on the value of the Accept header in the HTTP request, we have used it to return prettyfied well formated XML when the request Accept header includes text/xml and minified single lined XML when the request Accept header includes application/xml, when in doubt ask yourself who is going to read the response, an application or a human?