fix problems with XmlFactory.copy()