change exception message
works with or without <mteadata/>
take the right dom element if it already exists and write into the right resource