i have the following two class which convert object into xml string
should i do something like
class Person
{
public string GetXml()
{
//return a xml string
}
}
or it is better to create another class which accept the person as a parameter and convert it into XML something like
class PersonSerializer
{
public string Serialize(Person person)
{
// return a xml string
}
}
Thanks