Encode XML attributes
Added source metadata to notes