Reduce duplication in XML element objects