To enumerate all files of a specific path recursive and get the full path for each file using Microsoft PowerShell:
Get-ChildItem -rec | ForEach-Object -Process {$_.FullName}
to capture the output and generate an XML file do:
Get-ChildItem -rec | ForEach-Object -Process {$_.FullName} | Export-Clixml c:\temp\report.xml
to only enumerate / list files, use the psIsContainer switch:
Get-ChildItem -rec | Where-object {!$_.psIsContainer -eq $true} | ForEach-Object -Process {$_.FullName}
or for folders only:
Get-ChildItem -rec | Where-object {!$_.psIsContainer -eq $false} | ForEach-Object -Process {$_.FullName}
Your code to select folders only or files only can be shortened a little:
Files only: gci -rec | where {!($_.PSIsContainer)}
Folders only: gci -rec | where {$_.PSIsContainer}