feels like we should probably use a proper xml generation library for this eventually.