@@ -21,10 +21,11 @@ #include #import "OFURL.h" #import "OFString.h" #import "OFArray.h" +#import "OFXMLElement.h" #import "OFAutoreleasePool.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfMemoryException.h" @@ -528,21 +529,24 @@ - (OFString*)description { return [self string]; } -- (OFString*)stringBySerializing -{ - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; - OFString *ret = [[OFString alloc] - initWithFormat: @"(class=OFURL,version=0)<%@>", - [[self string] stringBySerializing]]; - - @try { - [pool release]; - } @finally { - [ret autorelease]; - } - - return ret; +- (OFXMLElement*)XMLElementBySerializing +{ + OFAutoreleasePool *pool; + OFXMLElement *element; + + element = [OFXMLElement elementWithName: @"object" + namespace: OF_SERIALIZATION_NS]; + + pool = [[OFAutoreleasePool alloc] init]; + + [element addAttributeWithName: @"class" + stringValue: [self className]]; + [element setStringValue: [self string]]; + + [pool release]; + + return element; } @end