diff --git a/HTMLKit/HTMLDocument.m b/HTMLKit/HTMLDocument.m
index 4c6a6ce..4dbf0fa 100644
--- a/HTMLKit/HTMLDocument.m
+++ b/HTMLKit/HTMLDocument.m
@@ -7,6 +7,11 @@
//
#import "HTMLDocument.h"
+#import "HTMLKitExceptions.h"
+
+@interface HTMLNode (Private)
+@property (nonatomic, strong) HTMLNode *parentNode;
+@end
@implementation HTMLDocument
@@ -19,4 +24,16 @@
return self;
}
+- (HTMLNode *)adoptNode:(HTMLNode *)node
+{
+ if (node.type == HTMLNodeDocument) {
+ [NSException raise:HTMLKitNotSupportedError
+ format:@"%@: Not Fount Error, adopting a document node. The operation is not supported.", NSStringFromSelector(_cmd)];
+ }
+
+ [node.parentNode removeChildNode:node];
+ node.parentNode = self;
+ return node;
+}
+
@end