String expected = "<types/>";
XStream xstream = new XStream();
xstream.registerConverter(new JavaBeanConverter(xstream.getMapper()), XStream.PRIORITY_VERY_LOW);
xstream.alias("types", TypesOfFields.class);
xstream.omitField(TypesOfFields.class, "trans");
xstream.omitField(TypesOfFields.class, "foo");
xstream.omitField(TypesOfFields.class, "normal");
String xml = xstream.toXML(fields);
assertEquals(expected, xml);