private static void CopyConfiguration(PackageGroup group, string parentName, string childName, XmlElement source, XmlElement target)
{
string aggregateXpath = string.Format("{0}/{1}/@name", parentName, childName);
List<string> names = group.FilterNames(source.Aggregate(aggregateXpath, XmlNamespaces.Manager));
if (names.Count != 0)
{
XmlNode parentNode = target.AppendElement(parentName.Replace("p:", string.Empty), XmlNamespaces.ProjectConfigurationNamespace);
foreach (string name in names)
{
string xpath = string.Format("{0}/{1}[@name='{2}']", parentName, childName, name);
parentNode.AppendChild(target.OwnerDocument.ImportNode(
source.SelectSingleNode(xpath, XmlNamespaces.Manager), true));
}
}
}