private XmlMapper addToImportMappingFile(XmlMapper mapper, string sourceXPath, string destinationXPath, decimal max, string name, string nameType)
{
string parentExternalName = destinationXPath.Split('/').Last();
string childSourceXPath = sourceXPath + "/" + name;
string childDestinationXPath = destinationXPath + "/" + name+ "/" + nameType;
XmlMappingRoute xmr = new XmlMappingRoute();
xmr.Source = new Source(childSourceXPath);
string sequence = parentExternalName;
if (max > 1)
{
sequence = nameType;
}
xmr.Destination = new Destination(childDestinationXPath, sequence);
mapper.Routes.Add(xmr);
return mapper;
}