public static AnnotationEntity Create(string annotation) { XDocument doc = XDocument.Parse(annotation); var documentAnnotations = new List <AnnotationEntity>(); var annotationEntity = new AnnotationEntity ( annotation ); doc.Descendants("Container").ToList().ForEach(container => { container.Descendants("Object").ToList().ForEach(annotationObject => { var annotationObjectEntity = new AnnotationObjectEntity ( Guid.Parse(annotationObject.Element("Guid").Value.ToString()), Convert.ToInt32(container.Element("PageNumber").Value.ToString()), true ); annotationEntity.AddAnnotation(annotationObjectEntity); }); }); return(annotationEntity); }