CXMLNode* Engine::FileSystem::Config::CXMLElement::ShallowClone( CXMLDocument* doc ) const { if ( !doc ) { doc = document; } CXMLElement* element = doc->NewElement( Value() ); // fixme: this will always allocate memory. Intern? for( const CXMLAttribute* a=FirstAttribute(); a; a=a->Next() ) { element->SetAttribute( a->Name(), a->Value() ); // fixme: this will always allocate memory. Intern? } return element; }