Generate xml string from object


Is there a way I can generate xml string from an object?
For instance, I got below object.

class Person{
String Name
String Age
String Address
class Address{
String AddressLine1
String State
String City

Person p1 = new Person()
p1.Name = ‘Mike’
p1.Address = new Address()
p1.Address.City = ‘New York City’

String p1_XML = ??

I want to have p1_XML as below
<City>New York City</City>

I know I can use variable and bind from the Request Message. However if the xml gets complicated or has list, it’s very hard to maintain.
How do you guys deal with list and complicated xml request?