Allow setting the xml with a function based on each element that is changing.