title: JAXB. Get boolean from string
body: <p>In my XML I have </p>
  
  <pre><code>&lt;myelem required="false"/&gt;
  </code></pre>
  
  <p>How I can read the <code>required</code> attribute as a boolean? I can read it as <code>String</code> and inside a getter do this: <code>return new Boolean(required)</code>
  But maybe there are some more elegant ways? </p>