private void Munge(XmlElement el)
{
XmlAttribute cond = GetConditional(el);
if (cond != null)
{
if (!new XppParser(cond.Value).Evaluate(this))
{
el.ParentNode.RemoveChild(el);
return;
}
else
{
el.RemoveAttributeNode(cond);
}
}
XmlNodeList nodes = el.ChildNodes;
XmlNode[] children = new XmlNode[nodes.Count];
for (int i = 0; i < children.Length; i++)
children[i] = nodes[i];
foreach (XmlNode child in children)
{
if (child is XmlElement)
Munge((XmlElement)child);
}
}