title: Jackson unable to consider @XmlElement while serializing to JSON
body: <p>I have a contract class that contains elements with @XmlElement tags. For ex</p>
  
  <pre><code> @XmlElement(name = "balancemoney")
   protected Amount balanceMoney;
  </code></pre>
  
  <p>Using the JAXBContext I am able to generate the xml with proper tags.</p>
  
  <p>However, when I use the jackson provided library, the JSON tag still comes in as 'balanceMoney' instead of 'balancemoney'</p>
  
  <p>How do I tell Jackson to consider the @XmlElement tag.</p>
  
  <p>Below is the code which does this.</p>
  
  <pre><code>    //Function to display request object.
  public void displayXML(Object reqResp){
      try{
          JAXBContext jaxbContext = JAXBContext.newInstance(reqResp.getClass());
          Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
  
          // output pretty printed
          jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
  
          ByteArrayOutputStream bStream=new ByteArrayOutputStream();
  
          //jaxbMarshaller.marshal(reqResp, System.out);
          jaxbMarshaller.marshal(reqResp,bStream );
  
          logger.info(bStream.toString());    
  
          }catch(JAXBException e){
              logger.info(e.getMessage());
          }
          logger.info("*** Payload is: " + reqResp.toString());
  }
  
  //Function to display as JSON
  public void displayJSON(Object reqResp) throws JsonGenerationException, JsonMappingException, IOException{
      ObjectMapper mapper = new ObjectMapper();
      logger.info(mapper.defaultPrettyPrintingWriter().writeValueAsString(reqResp));
  
  }
  </code></pre>