Question: Struggling a few hours on a simple ***MySQL*** *update syntax*. *Table*'s `votesum` column is a sum of `vote1`+`vote2` column. If there are several `votesum` values that are equal to each other (*20 and 20 like the example below*), I need to increase the `votesum` by 1 for the row that has the upper `vote1` value.

**Table**:

```
id|vote1|vote2|votesum
 1|10   |10   |20
 2|5    |15   |20
 3|2    |2    |4
 4|1    |1    |2

```

The ***MySQL*** *update syntax* I am looking for should check if maximum number of `votesum` is alone, or there are more equal votesum values. If there are two (or more) of them, then I need to increase value of `votesum`.

So after update table should look as follow:

```
id|vote1|vote2|votesum
 1|10   |10   |21
 2|5    |15   |20
 3|2    |2    |4
 4|1    |1    |2
 5|0    |2    |2

```

Remember that the top value of `votesum` are the ones that I needed to update. In the example above, `id=1` and `id=2` cannot be equal, but `id=4` and `id=5` can be equal, as I don't pay attention to those `votesum` values that isn't a top value.

Answer: 
You can use the `@XmlElementDecl` on a class annotated with `@XmlResistry` (usually `ObjectFactory` for this use case)

* <http://blog.bdoughan.com/2012/07/jaxb-and-root-elements.html>
Well thanks to Blaise's tutorial <http://blog.bdoughan.com/2012/07/jaxb-and-root-elements.html> ive managed to solve my problem. The solution was to implement an object factory with the classes of both xml's. Heres the code below. 

```
public static void main(String[] args) throws JAXBException, MalformedURLException, IOException {
    RequestMensagemCB requestMensagemCB = new RequestMensagemCB();
    XMLBinder xmlBinder = new XMLBinder();
    InputStreamReader isr = Request.doPost(url, xmlBinder.marshaller(requestMensagemCB));

    JAXBContext jc = JAXBContext.newInstance(ObjectFactory.class);
    Unmarshaller unmarshaller = jc.createUnmarshaller();

    Object object = (Object) unmarshaller.unmarshal(isr);
    Marshaller marshaller = jc.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    marshaller.marshal(object, System.out);
}

@XmlRegistry
public class ObjectFactory {

public ObjectFactory() {
}

public ResponseMensagemCB createResponseMensagemCB() {
    return new ResponseMensagemCB();
}

public ErrorRequest createErrorRequest() {
    return new ErrorRequest();
}
}

```