// Returns true if the element existed, false if it had to be created with "To be added." as value. private bool TryGetElement(string name, out XElement element) { element = Docs.Element(name); if (element == null) { element = new XElement(name); XmlHelper.AddChildFormattedAsXml(Docs, element, Configuration.ToBeAdded); return(false); } return(true); }