Your way was easier? You manually wrote out an XElement, converted it instantly to string (not Value, just ToString, which returns exactly what my method did, without any conversions.) There is really NO NEED for it to be that complicated lol. As for the bytes, you're implicitly converting them, chances are you should explicitly convert the array to a compatible data-type.