diff --git a/README.md b/README.md index 7b86ac60f..22786a79c 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,9 @@ Serialization is done very similar to JSON serialization: all that needs to chan ```java // Important: create XmlMapper; it will use proper factories, workarounds ObjectMapper xmlMapper = new XmlMapper(); -String xml = xmlMapper.writeValue(new Simple()); +String xml = xmlMapper.writeValueAsString(new Simple()); +// or +xmlMapper.writeValue(new File("/tmp/stuff.json"), new Simple()); ``` and with POJO like: