Added XML writing & test (w/o LINQ)