title: How can I add namespace prefix to XML using XStream in Spring Batch
body: <p>I am using XStreamMarshaller of Spring batch to generate XML, how can I add prefix namespace to nodes?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="userUnmarshaller" 
                  class="org.springframework.oxm.xstream.XStreamMarshaller"&gt;
          &lt;property name="aliases"&gt;
              &lt;util:map id="aliases"&gt;
                  &lt;entry key="user" value="com.app.User" /&gt;
              &lt;/util:map&gt;
          &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>My Java Object :</p>
  
  <pre class="lang-java prettyprint-override"><code>package com.app;
  
  public class User {
  
      int id;
      String username;
      String password;
      int age;
  
      //... getter and setter methods
  
  }
  </code></pre>
  
  <p>I get now something like that : </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;users&gt;
      &lt;user&gt;
          &lt;id&gt;1&lt;/id&gt;
          &lt;username&gt;app&lt;/username&gt;
          &lt;password&gt;password&lt;/password&gt;
          &lt;age&gt;30&lt;/age&gt;
      &lt;/user&gt;
  &lt;/users&gt;
  </code></pre>
  
  <p>but my need is : </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ns1:users&gt;
      &lt;ns2:user&gt;
          &lt;ns2:id&gt;1&lt;/ns2:id&gt;
          &lt;ns2:username&gt;app&lt;/ns2:username&gt;
          &lt;ns2:password&gt;password&lt;/ns2:password&gt;
          &lt;ns2:age&gt;30&lt;/ns2:age&gt;
      &lt;/ns2:user&gt;
  &lt;/ns1:users&gt;
  </code></pre>
  
  <p>I tried to add xstream alias annotation to User.java, but it doesn't seems to work.
  I really appreciate any help you can provide, Thank you</p>