private void FillCatalogsXML(Catalog catalog, XmlDocument xmlDoc, XmlElement rootElement)
{
if (catalog != null)
{
if (catalog.ParentCalalogID > 0)
{
Catalog parentCatalog = CatalogManager.GetCatalog(catalog.ParentCalalogID, CMSContext.LanguageID);
if (parentCatalog != null)
FillCatalogsXML(parentCatalog, xmlDoc, rootElement);
}
XmlElement catalogElement = xmlDoc.CreateElement("Element");
rootElement.AppendChild(catalogElement);
XmlAttribute attr = xmlDoc.CreateAttribute("ID");
attr.Value = catalog.ID.ToString();
catalogElement.Attributes.Append(attr);
attr = xmlDoc.CreateAttribute("Name");
attr.Value = catalog.Name;
catalogElement.Attributes.Append(attr);
attr = xmlDoc.CreateAttribute("Type");
attr.Value = "Catalog";
catalogElement.Attributes.Append(attr);
}
}