title: XMLBeans - xsi:type stripped using Axis2 and Tomcat?
body: <p>I’m new to XMLBeans and have been trying to use it to create an XML document as part of an axis2 web service.  When I run my code as a standard Java application or as a standard servlet, the XML is correctly generated:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;c:BroadsoftDocument protocol="OCI" xmlns:c="C"&gt;
  &lt;sessionId&gt;000000001&lt;/sessionId&gt;
  &lt;command xsi:type="AuthenticationRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;userId&gt;admin&lt;/userId&gt;&lt;/command&gt;
  &lt;/c:BroadsoftDocument&gt;
  </code></pre>
  
  <p>However, when the exact same code is run under Axis2 &amp; Tomcat in a servlet I get:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;c:BroadsoftDocument protocol="OCI" xmlns:c="C"&gt;
  &lt;sessionId&gt;000000001&lt;/sessionId&gt;
  &lt;command&gt;
  &lt;userId&gt;admin&lt;/userId&gt;&lt;/command&gt;
  &lt;/c:BroadsoftDocument&gt;
  </code></pre>
  
  <p>This of course isn’t valid – the xsi:type of the “command” element is stripped when the code is run under Tomcat.</p>
  
  <p>Does anyone have any suggestions of what I could be doing wrong that would cause this type of issue only when running under Axis2?  At first I thought it was a Tomcat issue, but after creating a generic servlet and running the exact same code I don't have any issues.  I've tried playing with the XMLOptions for XMLBeans, but couldn't seem to resolve the problem.  The options I'm currently using are:</p>
  
  <pre><code>xmlOptions = new XmlOptions();
  xmlOptions.setCharacterEncoding("UTF-8");
  xmlOptions.setUseDefaultNamespace();
  xmlOptions.setSaveAggressiveNamespaces();
  xmlOptions.setSavePrettyPrint();
  </code></pre>