title: Partial mapping of XML in JAXB (MOXy)
body: <p>I would like to unmarshall only the <strong>trk</strong> and its child elements from the below XML. However, I want to create <strong>gpx</strong> as the root element while marshalling</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;p:gpx creator="" version="1.1" xmlns:p="http://www.topografix.com/GPX/1/1""&gt;
      &lt;p:trk&gt;
          &lt;p:name&gt;Test Track&lt;/p:name&gt;
      &lt;/p:trk&gt;
  &lt;/p:gpx&gt;
  </code></pre>
  
  <p>MOXy external meta-data is defined as below</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xml-accessor-type="PROPERTY" package-name="Debrief.Wrappers"&gt;
  
      &lt;xml-schema element-form-default="QUALIFIED"&gt;
          &lt;xml-ns prefix="p" namespace-uri="http://www.topografix.com/GPX/1/1" /&gt;
      &lt;/xml-schema&gt;
  
      &lt;java-types&gt;
          &lt;java-type name="TrackWrapper"&gt;
          &lt;xml-root-element name="gpx"/&gt;
              &lt;java-attributes&gt;
                  &lt;xml-attribute xml-path="trk/name/text()" java-attribute="name"/&gt;
              &lt;/java-attributes&gt;
          &lt;/java-type&gt;
      &lt;/java-types&gt;
  &lt;/xml-bindings&gt;
  </code></pre>
  
  <p>The below code</p>
  
  <pre class="lang-java prettyprint-override"><code>Map&lt;String, Object&gt; props = new HashMap&lt;String, Object&gt;();
  props.put(JAXBContextProperties.OXM_METADATA_SOURCE, this.getClass().getResourceAsStream("gpx-bindings.xml"));
  
  jaxbContext = JAXBContext.newInstance("Debrief.Wrappers:Debrief.Wrappers.Track", TrackWrapper.class.getClassLoader(), props);
  Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
  Object unmarshal = unmarshaller.unmarshal(this.getClass().getResourceAsStream("gpx-data.xml"));
  </code></pre>
  
  <p>is throwing this exception</p>
  
  <pre class="lang-java prettyprint-override"><code>[Exception [EclipseLink-25008] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.XMLMarshalException
  Exception Description: A descriptor with default root element {http://www.topografix.com/GPX/1/1}gpx was not found in the project]
      at org.eclipse.persistence.jaxb.JAXBUnmarshaller.handleXMLMarshalException(JAXBUnmarshaller.java:956)
      at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:529)
      at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:149)
      at org.mwc.debrief.core.loaders.GPXLoader.doTheLoad(GPXLoader.java:70)
      at org.mwc.debrief.core.loaders.GPXLoader.main(GPXLoader.java:40)
  Caused by: Exception [EclipseLink-25008] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.XMLMarshalException
  Exception Description: A descriptor with default root element {http://www.topografix.com/GPX/1/1}gpx was not found in the project
      at org.eclipse.persistence.exceptions.XMLMarshalException.noDescriptorWithMatchingRootElement(XMLMarshalException.java:143)
      at org.eclipse.persistence.internal.oxm.record.SAXUnmarshallerHandler.startElement(SAXUnmarshallerHandler.java:219)
      at org.eclipse.persistence.internal.oxm.record.XMLStreamReaderReader.parseEvent(XMLStreamReaderReader.java:111)
      at org.eclipse.persistence.internal.oxm.record.XMLStreamReaderReader.parse(XMLStreamReaderReader.java:83)
      at org.eclipse.persistence.internal.oxm.record.XMLStreamReaderReader.parse(XMLStreamReaderReader.java:72)
      at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:794)
      at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:660)
      at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:526)
      ... 3 more
  </code></pre>
  
  <p>Not sure what I am missing. </p>