title: How to marshal an object via JAXB without any information about it?
body: <p>I have an object <code>value</code>, which is of some type, either <code>@XmlRootElement</code>-annotated, or not. I want to marshal it into XML:</p>
  
  <pre><code>String value1 = "test";
  assertEquals("&lt;foo&gt;test&lt;/foo&gt;", toXml("foo", value1));
  // ...
  @XmlRootElement
  class Bar {
    public String bar = "test";
  }
  assertEquals("&lt;foo&gt;&lt;bar&gt;test&lt;/bar&gt;&lt;/foo&gt;", toXml("foo", new Bar()));
  </code></pre>
  
  <p>Can I do it with JAXB existing facilities, or I should create some custom analyzer?</p>