Modified fillElement() to rewrite children if delete flag inculded