   take a look at  traverse the .x file.
void ParseObject(IDirectXFileData *pData){IDirectXFileObject *pObject = NULL;IDirectXFileData *pSubData = NULL;IDirectXFileDataReference *pRef = NULL;// Scan for embedded objectswhile(SUCCEEDED(pData->GetNextObject(&pObject))) {// Look for referenced objectsif(SUCCEEDED(pObject->QueryInterface( IID_IDirectXFileDataReference, (void**)&pRef))) {// Resolve the data objectpRef->Resolve(&pSubData);// Parse the object by calling ParseObjectParseObject(pSubData);// Free interfacespSubData->Release();pRef->Release();}// Look for instanced objectsif(SUCCEEDED(pObject->QueryInterface( IID_IDirectXFileData, (void**)&pSubData))) {// Parse the object by calling ParseObjectParseObject(pSubData);// Free the object interfacepSubData->Release();}// Free the interface for next object to usepObject->Release();}}it seem to has a bug.it only get a subObject. if a parentObject has more than one subObject, it seem to be only access a subObject. the code is from advanced_animation_with_directx by Jim Adams.maybe in .x file is there only a childobject under a parentojbect?   
  I found the problem here:while(SUCCEEDED(IDirectXFileData::GetNextObject(IDirectXFileObject))){}GetNextObject does the job: it get subobject of a object. but it CAN remember position ,so when GetNextObject call again. it will get next subobjectright?   