title: Unmarshalling to static types using XStream
body: <p>I have an XML file of the following format:</p>
  
  <pre><code>&lt;TRequest&gt;
      &lt;Item&gt;
          &lt;ItemIdentification&gt;
              &lt;ItemStandardID Qualifier="XX"&gt;egosdhgsuh&lt;/ItemStandardID&gt;
          &lt;/ItemIdentification&gt;
      &lt;/Item&gt;
      &lt;Item&gt;
      ....
      &lt;/Item&gt;
  &lt;/TRequest&gt;
  </code></pre>
  
  <p>From the associated WSLD's XSD I have generated Java code using JaxB. This gives me the following hierarchy:</p>
  
  <pre><code>public class TRequest extends Request {
  
      protected List&lt;TRequest.Item&gt; item;
  
      public static class Item {
  
          protected TRequest.Item.ItemIdentification itemIdentification;
  
          public static class ItemIdentification {
  
              protected TRequest.Item.ItemIdentification.ItemStandardID itemStandardID;
  
              public static class ItemStandardID {
  
              }
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>I am trying to read the <code>Item</code>s inside a <code>TRequest</code> using <code>XStreamMarshaller</code>:</p>
  
  <pre><code>    final XStreamMarshaller unmarshaller = new XStreamMarshaller();
      final ImmutableMap&lt;String, ?&gt; of = ImmutableMap.of(
              "Item", TRequest.Item.class,
              "ItemIdentification", TRequest.Item.ItemIdentification.class
      );
      unmarshaller.setAliasesByType(of);
  </code></pre>
  
  <p>But when I try to unmarshall it I get the following error:</p>
  
  <pre><code>org.springframework.oxm.UnmarshallingFailureException: XStream unmarshalling exception; nested exception is com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: No such field com.mycompany.TRequest$Item.ItemIdentification
  ---- Debugging information ----
  field               : ItemIdentification
  class               : com.mycompany.TRequest$Item
  required-type       : com.mycompany.TRequest$Item
  converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
  path                : /Item/ItemIdentification
  line number         : 2
  version             : 4.3.13.RELEASE
  -------------------------------
  </code></pre>
  
  <p>In the above call to setAliasesByType, I have tried things such as <code>Item.ItemIdentification</code>, <code>Item$ItemIdentification</code> etc as the key mapping to <code>TRequest.Item.ItemIdentification.class</code>.</p>
  
  <p>What is the correct way to achieve this?</p>