16 lines
389 B
C#
16 lines
389 B
C#
namespace Yes.Infrastructure.Rss
|
|
{
|
|
public static class XDocumentExtensions
|
|
{
|
|
public static string ToStringWithDeclaration(this XDocument doc)
|
|
{
|
|
if (doc.Declaration == null)
|
|
return doc.ToString();
|
|
|
|
using var writer = new StringWriter();
|
|
doc.Save(writer);
|
|
return writer.ToString();
|
|
}
|
|
}
|
|
}
|