Maybe this isn't possible in powershell (without actually loading C# code)
The following code returns an error:
$settings = New-Object system.Xml.XmlWriterSettings;
$settings.Indent = $true;
$settings.OmitXmlDeclaration = $true;
$settings.NewLineOnAttributes = $true;
$path = 'c:\test\meh.xml'
Add-Type -AssemblyName 'System.Xml'
$writerClass = New-Object XML.XmlTextWriter $path, ([Text.Encoding]::Unicode)
$writer = New-Object ([System.Xml.XmlWriter]::Create($writerClass,$settings))
New-Object : Cannot find type [System.Xml.XmlCharCheckingWriter]: verify that the assembly containing this type is loaded.
XmlCharCheckingWriter is an internal class which may be the cause of the problem?. I'm not sure how you would make this work with powershell.