@Test
public void serializeXml() throws Exception
{

    Writer jsonWriter = new StringWriter();
    ToXmlGenerator jsonGenerator = new XmlFactory().createGenerator( jsonWriter );
    SerializerProvider serializerProvider = new ObjectMapper().getSerializerProvider();
    jsonGenerator.setNextName( new QName( "urn:test", "lastUpdatedBy" ) );
    new CustomLastUpdatedUserSerializer().serialize( user, jsonGenerator, serializerProvider );
    jsonGenerator.flush();
    assertEquals( "<wstxns1:lastUpdatedBy xmlns:wstxns1=\"urn:test\" id=\"jshfdkd323\" name=\"Peter Brown\"/>", jsonWriter.toString() );
}