Exception StateError (string occured) { return InvalidOperation (String.Format ("This XmlWriter does not accept {0} at this state {1}.", occured, state)); } }