Try the following:
using System.Text;
using System.Xml;
XmlDocument dom = GetDocument();
byte[] bytes = Encoding.Default.GetBytes(dom.OuterXml);
If you want to preserve the text encoding of the document, then change the Default
encoding to the desired encoding, or follow Jon Skeet’s suggestion.