public ImmutableOptions(DeclarationHandling declarationHandling, TextNodeHandling textNodeHandling, AttributeHandling attributeHandling, CommentHandling commentHandling, ProcessingInstructionHandling processingInstructionHandling)
 {
     DeclarationHandling           = declarationHandling;
     TextNodeHandling              = textNodeHandling;
     AttributeHandling             = attributeHandling;
     CommentHandling               = commentHandling;
     ProcessingInstructionHandling = processingInstructionHandling;
 }
        private static void CompareDeclarations(XDeclaration a, XDeclaration b, DeclarationHandling declarationHandling)
        {
            switch (declarationHandling)
            {
            case DeclarationHandling.Compare:
                if (a == null && b == null)
                {
                    return;
                }

                if (a == null || b == null)
                {
                    throw new UnequalityException(new UnequalityReason("Declaration was defined in only one document", a, b));
                }

                if (a.Encoding != b.Encoding)
                {
                    throw new UnequalityException(new UnequalityReason("Different declaration encodings", a, b));
                }

                if (a.Standalone != b.Standalone)
                {
                    throw new UnequalityException(new UnequalityReason("Different declaration standalone values", a, b));
                }

                if (a.Version != b.Version)
                {
                    throw new UnequalityException(new UnequalityReason("Different declaration versions", a, b));
                }

                return;

            case DeclarationHandling.Ignore:
                return;

            default:
                return;
            }
        }