if ( bom != null )
{
in = new SequenceInputStream( new ByteArrayInputStream( bom ), in );
}
XmlStreamReader reader = new XmlStreamReader( in );
assertEquals( encoding, reader.getEncoding() );
String result = IOUtil.toString( reader );
assertEquals( xml, result );
}