private static string NodeAttr(string name, string attributes, params string[] contents) {
StringBuilder buffer = new StringBuilder();
buffer.Append('<').Append(name);
if (attributes != null)
{
buffer.Append(" ").Append(attributes);
}
buffer.Append('>');
foreach (string content in contents)
{
buffer.Append(content);
}
buffer.Append("</").Append(name).Append('>');
return buffer.ToString();
}
}