One tiny prob with that: you actually need to specify "x2" as the format string to make sure a leading zero is added when the byte is less than 0xF.
           
StringBuilder hex = new StringBuilder();
foreach (byte b in new byte[] { 0x01, 0xa, 0xa })
   hex.AppendFormat("{0:x2}", b);
               
Console.WriteLine(hex.ToString());