title: JAXB, XSD stylesheets, and element name conflict resolution
body: <p>This is more of an academic question, but I started working on configuring JAXB schema validation because I was researching what would happen using more than one schema with an element name conflict.  Is it possible to configure JAXB and have schema files which support an XML document which looks something like this?</p>
  
  <pre><code>&lt;my:inventory 
      xmlns:my="http://www.my.com"
      xmlns:ab="http://www.ab.com"
      xmlns:xy="http://www.xy.com"&gt;
  
      &lt;my:products&gt;
          &lt;ab:product&gt;
            &lt;id&gt;123&lt;/id&gt;
            &lt;desc&gt;some ap product&lt;/desc&gt;
            &lt;price&gt;12.22&lt;/price&gt;
          &lt;/ab:product&gt;
          &lt;xy:product&gt;
            &lt;key&gt;123&lt;/key&gt;
            &lt;title&gt;some xy product&lt;/title&gt;
            &lt;cost&gt;63.45&lt;/cost&gt;
          &lt;/xy:product&gt;
      &lt;/my:products&gt;
  &lt;/my:inventory&gt;
  </code></pre>
  
  <p>The basic idea is to have product information from both AB company and XY company.  The two companies have the same data but store them in different tags.  I would like to have MY company schema to define an inventory of products from the two other companies.</p>
  
  <p>I started to create the XSD files and the JAXB annotated classes for this. It quickly spiraled into an unending stream of configuration and parsing exceptions, so I thought I'd ask.</p>