Index: trunk/Include/Classes/System/Xml/XmlDeclaration.ab
===================================================================
--- trunk/Include/Classes/System/Xml/XmlDeclaration.ab	(revision 450)
+++ trunk/Include/Classes/System/Xml/XmlDeclaration.ab	(revision 451)
@@ -26,5 +26,10 @@
 
 	Override Function OwnerXmlSupportedIndent( isIndent = False As Boolean, indent = 0 As Long ) As String
-		Return "<?" + InnerXml + "?>"
+		Dim crlfStr = ""
+		If isIndent Then
+			' インデントをサポートする場合
+			crlfStr = Ex"\r\n"
+		End If
+		Return "<?" + InnerXml + "?>" + crlfStr
 	End Function
 End Class
Index: trunk/Include/Classes/System/Xml/XmlDocument.ab
===================================================================
--- trunk/Include/Classes/System/Xml/XmlDocument.ab	(revision 450)
+++ trunk/Include/Classes/System/Xml/XmlDocument.ab	(revision 451)
@@ -37,4 +37,22 @@
 	'End Sub
 
+
+	'----------------------------------------------------------------
+	' パブリック プロパティ
+	'----------------------------------------------------------------
+
+	/*!
+	@brief	このノードとそのすべての子ノードを表すマークアップを取得します。
+	@return	このノードとそのすべての子ノードを格納しているマークアップ。
+	*/
+	Override Function OuterXml() As String
+		Return This.InnerXml
+	End Function
+
+
+	'----------------------------------------------------------------
+	' パブリック メソッド
+	'----------------------------------------------------------------
+
 	/*!
 	@brief	指定した値を使用して、XmlDeclaration ノードを作成します。
@@ -68,10 +86,28 @@
 
 	/*!
-	@brief	このノードとそのすべての子ノードを表すマークアップを取得します。
-	@return	このノードとそのすべての子ノードを格納しているマークアップ。
+	@brief	指定した文字列を使用してテキストノードを作成します。
+	@param	text 文字列。
 	*/
-	Override Function OuterXml() As String
-		Return This.InnerXml
+	Function CreateTextNode( text As String ) As XmlText
+		Return New XmlText( text, This )
 	End Function
+
+	/*!
+	@brief	指定したストリームにXML文書を保存する。
+	@param	stream 保存先のストリーム。
+	*/
+	Virtual Sub Save( outStream As System.IO.Stream )
+		Dim xmlStr = InnerXmlSupportedIndent( True )
+		outStream.Write( xmlStr.StrPtr As *Byte, 0, xmlStr.Length * SizeOf( StrChar ) )
+	End Sub
+
+	/*!
+	@brief	指定したファイルにXML文書を保存する。
+	@param	ファイルパス。
+	*/
+	Virtual Sub Save( filename As String )
+		Dim fileStream As System.IO.FileStream( filename, System.IO.FileMode.Create )
+		Save( fileStream )
+	End Sub
 
 End Class
Index: trunk/Include/Classes/System/Xml/XmlNode.ab
===================================================================
--- trunk/Include/Classes/System/Xml/XmlNode.ab	(revision 450)
+++ trunk/Include/Classes/System/Xml/XmlNode.ab	(revision 451)
@@ -43,4 +43,5 @@
 	*/
 	Sub XmlNode( nodeType As XmlNodeType, prefix As String, localName As String, namespaceURI As String, doc As XmlDocument )
+		This.nodeType = nodeType
 		This.prefix = prefix
 		This.localName = localName
@@ -57,4 +58,5 @@
 	*/
 	Sub XmlNode( nodeType As XmlNodeType, data As String, doc As XmlDocument )
+		This.nodeType = nodeType
 		This.prefix = Nothing
 		This.localName = Nothing
@@ -304,5 +306,5 @@
 		End If
 
-		If childNodes.Count = 0 Then
+		If This.childNodes.Count = 0 Then
 			Return indentStr + "<" + localName + This.GetAttributesStr() + " />" + crlfStr
 		End If
@@ -310,12 +312,25 @@
 		Dim result = ""
 
-		' 開始タグ
-		result += indentStr + "<" + localName + This.GetAttributesStr() + ">" + crlfStr
-
-		' 子ノードリスト
-		result += InnerXmlSupportedIndent( isIndent, indent + 1 )
-
-		' 終了タグ
-		result += indentStr + "</" + localName + ">" + crlfStr
+		If This.FirstChild.NodeType = XmlNodeType.Text Then
+			' 子ノードがテキストのときは開始タグ、終了タグの間にインデントや改行を入れない
+
+			' 開始タグ
+			result += indentStr + "<" + localName + This.GetAttributesStr() + ">"
+
+			' 子ノードリスト
+			result += InnerXmlSupportedIndent( isIndent, indent + 1 )
+
+			' 終了タグ
+			result += "</" + localName + ">" + crlfStr
+		Else
+			' 開始タグ
+			result += indentStr + "<" + localName + This.GetAttributesStr() + ">" + crlfStr
+
+			' 子ノードリスト
+			result += InnerXmlSupportedIndent( isIndent, indent + 1 )
+
+			' 終了タグ
+			result += indentStr + "</" + localName + ">" + crlfStr
+		End If
 
 		Return result
Index: trunk/Include/Classes/System/Xml/XmlText.ab
===================================================================
--- trunk/Include/Classes/System/Xml/XmlText.ab	(revision 450)
+++ trunk/Include/Classes/System/Xml/XmlText.ab	(revision 451)
@@ -16,4 +16,13 @@
 		XmlCharacterData( XmlNodeType.Text, strData, doc )
 	End Sub
+
+Protected
+	Override Function InnerXmlSupportedIndent( isIndent = False As Boolean, indent = 0 As Long ) As String
+		Return Value
+	End Function
+
+	Override Function OwnerXmlSupportedIndent( isIndent = False As Boolean, indent = 0 As Long ) As String
+		Return Value
+	End Function
 End Class
 
