title: JAXB Multiple Content for Element
body: <p>I'm currently working on a txt-to-xml project. Basically what I'm doing is creating different XmlElements for some of the content. 
  I got a DTD up and running and for now I'm creating a default xml, just to make sure every xml created is a valid xml (for the DTD given).
  I'm mainly creating new Classes for every Element, which doesn't have a #PCDATA structure and it's working pretty fine so far.
  Now I'm struggling with a problem:
  I got the following in my DTD:</p>
  
  <pre><code>&lt;!ELEMENT REACTION(#PCDATA | ACTOR*)&gt;
  </code></pre>
  
  <p>What I'm looking for in my Text is something like:</p>
  
  <blockquote>
    <p>Prof. X clapped!</p>
  </blockquote>
  
  <p>and I want to extract this into my XML as:</p>
  
  <pre><code>&lt;REACTION&gt;
    &lt;ACTOR&gt;Prof. X&lt;/ACTOR&gt; clapped!
  &lt;/REACTION&gt;
  </code></pre>
  
  <p>So what I basically want is a String-Attribute within the ReactionClass which is devlares as XML-Element but holds an Actor-Attribute + Rest of the Text. I thought of something like:</p>
  
  <pre><code>String m_sText;
  String m_sActor;
  
  public ReactionClass(){ 
   this.Actor = "Prof. X";
   this.sText = this.m_sActor + " clapped!";
  }
  
  @XmlElement(name = "TEXT")
  public String getM_sText(){ return this.m_sText; }
  
  @XmlElement(name = "ACTOR")
  public String getM_sActor(){ return this.m_sActor; }
  </code></pre>
  
  <p>For all other Nodes, such as the RootNode I created a RootNodeClass which holds different attributes, such as m_nLocation, m_nTime, m_nYear which are declared as XML-Elements, so the JAXB-Marshaller just builds up the XML on basis of these elements:</p>
  
  <pre><code>&lt;ROOT&gt;
   &lt;TIME&gt;09:00&lt;/TIME&gt;
   &lt;LOCATION&gt;New York&lt;/TIME&gt;
   &lt;YEAR&gt;1992&lt;/YEAR&gt;
  &lt;/ROOT&gt;
  </code></pre>
  
  <p>I wanted to do the same with the REACTION-Node (like mentioned above), but when creating a new Class REACTION I'm getting sth. like:</p>
  
  <pre><code>&lt;REACTION&gt;
    &lt;TEXT&gt;Prof. X clapped!&lt;/TEXT&gt;
    &lt;ACTOR&gt;Prof. X&lt;/ACTOR&gt;
  &lt;/REACTION&gt;
  </code></pre>
  
  <p>How would I put them into one Element but still keep the Tags such as above?
  If anybody got an idea how to manage this I would be very thankful!</p>
  
  <p>Thanks Max</p>