Use XML serialization

Replace XML parsing with serialization for simplicity.