Start adding WriteXml function

For now it just writes out the repetetive bits that are a cluster to do
by hand, but it's a start