code: public static XmlSerializer getXmlSerializer(StringWriter outWriter) throws IllegalArgumentException,
              IllegalStateException, IOException {
          XmlSerializer serializer = Xml.newSerializer();
          serializer.setOutput(outWriter);
  
          return serializer;
      }
docs: Returns a <code>XmlSerializer</code> which outputs to the specified <code>StringWriter</code>
  
  @param outWriter
  the <code>StringWriter</code> to output to
  @return A <code>XmlSerializer</code> instance
  
  @throws IOException
  if there is an error setting the output.
  @throws IllegalStateException
  if there is an error setting the output.
  @throws IllegalArgumentException
  if there is an error setting the output.