title: Use Jackson to write yaml?
body: <p>I'm using Jackson to read and modify yaml files. Works great. I can't find the magic incantations needed to write the yaml, though.</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
  ObjectNode root = (ObjectNode)mapper.readTree(yamlFileIn);
  // modify root here
  mapper.writeValue(yamlFileOut, root); // writes json, not yaml. not sure why.
  </code></pre>
  
  <p>I'm sure it's some combination of writers, JsonGenerators, and something else. Anyone got sample code?</p>