IDEX-1619: made replaceWith not permitted on root element
IDEX-1619: added Element#setChild method