public override string ReadOuterXml() {
if (ReadState == ReadState.Interactive) {
if (NodeType == XmlNodeType.Element) {
StringOutput output = new StringOutput(this.processor);
output.OmitXmlDecl();
bool emptyElement = IsEmptyElement;
int depth = Depth;
// process current record
output.RecordDone(this.builder);
Read();
// process internal elements & text nodes
while(depth < Depth) {
Debug.Assert(this.builder != null);
output.RecordDone(this.builder);
Read();
}
// process end element
if (! emptyElement) {
output.RecordDone(this.builder);
Read();
}
output.TheEnd();
return output.Result;
}
else if(NodeType == XmlNodeType.Attribute) {
return encoder.AtributeOuterXml(Name, Value);
}
else {
Read();
}
}
return string.Empty;
}